Reputation: 19
The following SELECT
query doesn't work properly:
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'
I have 2 tables: student
and memberslist
and when I run the query, the result is the following:
I don't understand why it gives me the row pakalu
when the WHERE
was 'Elite League of Information Technology Student'
Upvotes: 0
Views: 26
Reputation: 37023
Usage of implicit join is discouraged, you need following query:
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'
Upvotes: 3