SELECT *
FROM `placement_ans` A, `placement_quiz` B
left join `placement_time` C on (A.state=C.state)
where
A.no_place=C.no_place and A.no_stu=C.no_stu and A.no_place=B.no_place and A.place_q=B.no_q and YEAR(A.place_date) = YEAR(curdate()) and MONTH(A.place_date) = MONTH(curdate()) and A.no_place=208 and A.no_stu=793 order by A.place_q ASC
誤差 未知列「A.state」在「關於條款」左連接有一個「未知列」錯誤
我使用
SELECT *
FROM `placement_ans` A, `placement_quiz` B
left join `placement_time` C on (placement_ans.state=C.state)
where
A.no_place=C.no_place and A.no_stu=C.no_stu and A.no_place=B.no_place and A.place_q=B.no_q and YEAR(A.place_date) = YEAR(curdate()) and MONTH(A.place_date) = MONTH(curdate()) and A.no_place=208 and A.no_stu=793 order by A.place_q ASC
也試過,但它不」不像是會要工作
我有一個像
placement_time
state num
100 10
表
和
placement_ans
state something
100 11
100 22
55 33
22 55
33 77
,我想打印出來的表格,多數民衆贊成
placement_ans
state something num
100 11 10
100 22 10
55 33 null
22 55 null
33 77 null
這意味着該表中沒有這樣的列。除非你添加它,否則你不能使它工作。 –
表中有一列名爲「狀態」的列表placement_ans – user54987
數據庫告訴你沒有。使用'SHOW CREATE TABLE placement_ans'再次檢查。不管你提出什麼查詢,如果數據庫說沒有這樣的列,那麼就沒有這樣的列。 –