我从来没有这样做过,它只是为了在 asp.net 中的 gridview 控件上显示信息。
这是我所拥有的:
SELECT [VisitNumber], [Date], [DateFreq], [Weight], [Fat], [BloodPressure], [Pulse], [Total], [Discount], [NetTotal], [AmountPaid], [PaymentStatus], [TypeOfPayment], [Comments] FROM [tblVisits] WHERE ([PatientID] = '16')
SELECT [DatePrescribed], [AdditionalSupply], [Medication], [Dose], [Quantity], [Type], [Description], [Expires], [Lot] FROM [tblMedications] WHERE (([PatientID] = '16') AND ([DatePrescribed] = (select top 1 dateprescribed from tblMedications where ([PatientID] = '16') order by DatePrescribed desc))) ORDER BY [DatePrescribed] DESC
有没有办法将它们结合起来,也许是对 PatientID 的完全加入?我对sql不是很好,所以任何想法都会受到赞赏。