1
獲取屬性這是我的數據庫架構:SQL:通過連接3臺
我只是想選擇一個病人的所有的約會,並得到以下結果集:
我曾嘗試以下加入:
SELECT [User].user_id,name, surname, [Appointment].day,[Appointment].month,[Appointment].year,[Appointment].hour,[Appointment].minutes
FROM [User]
LEFT JOIN [Doctor] ON [Doctor].user_id = [User].user_id
LEFT JOIN [Patient] ON [Patient].user_id = [User].user_id
LEFT JOIN [Appointment] ON [Doctor].doctor_id = [Appointment].doctor_id and [Patient].patient_id = [Appointment].patient_id
但我沒有得到所需的輸出!