Justin Palmer wrote:
Hi List,
I have the following query where I am trying to locate a single students
record. I only know that the students record has an id of 3690 and an
employer_id of 3 possibles. So I thought that OR would work great. The
problem is that it returns all students with employer_id's of 3, 78, 79.
How do I construct the query correctly to accomplish what I am after,
without only using the student_id? I need to verify and return the
employer_id.
SELECT student_id, employer_id
FROM wat_student_job
WHERE student_id = 3690
AND employer_id = 3
OR employer_id = 78
OR employer_id = 79
Thanks in advance.
Regards,
Justin Palmer
an IN list may be what you want here....
WHERE student_id = 3690 AND employer_id IN (3, 78, 79);
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]