以下SELECT
查询无法正常运行:
SELECT DISTINCT
student.firstname,
student.lastname,
student.emailAddress,
cast(memberslist.dateJoined as DATE) as dateJoined
FROM student, memberslist
WHERE
memberslist.orgName = 'Elite League of Information Technology Students'
AND memberslist.joined = 'yes'
我有2个表:student
和memberslist
当我运行查询时,结果如下:
我不明白为什么当pakalu
是精英信息技术联盟的学生'
WHERE
行
答案 0 :(得分:3)
不鼓励使用隐式连接,您需要以下查询:
SELECT s.firstname, s.lastname, s.emailAddress, cast(m.dateJoined as DATE) as dateJoined
FROM student s INNER JOIN memberslist m
ON s.emailAddress = m.emailAddress
WHERE m.orgName = 'Elite League of Information Technology Students'
AND m.joined = 'yes'