我需要顯示每個醫生avaible了幾個小時,但我的代碼沒有返回 這裏是我的代碼:選擇命令不返回任何
SELECT DISTINCT Hours
FROM agenda_hours, doctor
WHERE Agenda_Hours.idHours NOT IN (SELECT DISTINCT appoitment_hour.Hour FROM appoitment_hour)
AND Doctor.Name IN (SELECT Doctor.Name FROM Doctor Where name = "Name");
這是表的說明
+---------------+--------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +---------------+--------------+------+-----+---------+-------+ | id | int(11) | NO | PRI | NULL | | | Name | varchar(100) | NO | | NULL | | | CRM | varchar(20) | NO | | NULL | | | Tel | varchar(10) | YES | | NULL | | | Cel | varchar(10) | YES | | NULL | | | RG | varchar(40) | YES | | NULL | | | CPF | varchar(50) | YES | | NULL | | | Street | varchar(120) | YES | | NULL | | | num | varchar(7) | YES | | NULL | | | bairro | varchar(40) | YES | | NULL | | | city | varchar(70) | YES | | NULL | | | zip | varchar(13) | YES | | NULL | | | datanasc | varchar(20) | YES | | NULL | | | Especiality | varchar(100) | YES | | NULL | | +---------------+--------------+------+-----+---------+-------+
我們不能在沒有看到任何實際數據的情況下給您提供幫助 –
也許嘗試將'appoitment_hour'更改爲'appointment_hour'? – edsioufi