Thread: MySQL Select statement
Results 1 to 2 of 2
How to write if statement in MySQL Forum: PHP ForumReplies: 2
Syntax for Select Statement Forum: DatabasesReplies: 2
Problem in mysql statement and if condition Forum: PHP ForumReplies: 2
Select Case SQL Statement... Forum: DatabasesReplies: 7
Downgrade to non-sub query, but how to change this mysql statement?? Forum: PHP ForumReplies: 0
07-18-2005, 04:03 PM #1
MySQL Select statement
I have a database that has a column of int named crsnum.
I need to select data from this db omiting certian crsnum's, and a certin email match from the email field example:
"SELECT * FROM login
WHERE (Email = '$email') ORDER BY ID DESC";
Works great but I need to add " WHERE Crsnum != 1,3,6,9,19 " so these crsnums are omited from the select.
Thanks in advance.
09-11-2005, 02:51 PM #2
Re: MySQL Select statement
Here's what that should look like:
"SELECT * FROM login WHERE (Email = '$email') AND Crsnum NOT IN (1,3,6,9,19) ORDER BY ID DESC";