答案1
SELECT DISTINCT candidate.Cand_ID,candidate.Cand_Name
FROM candidate,interview
WHERE interview.Interview_Result = 'Pass'
AND interview.Interview_Round IN ('First','Second')
AND interview.Cand_ID = candidate.Cand_ID
ORDER BY candidate.Cand_ID DESC LIMIT
在此处使用INNER JOIN
。似乎您正在连接两个表并根据另一个表放置 where 子句。请尝试以下方法:
SELECT DISTINCT candidate.Cand_ID,candidate.Cand_Name
FROM candidate INNER JOIN interview ON candidate.yourcommonfield = interview.yourcommonfield
WHERE interview.Interview_Result = 'Pass'
AND interview.Interview_Round IN ('First','Second')
ORDER BY candidate.Cand_ID DESC LIMIT
创建表的 SQL 代码是什么?
您应该使用CREATE TABLE
查询来创建所需的表。