OZONE Asylum
FAQ
How do I make a 'not equal to' statement in MySQL?
This page's ID:
5402
Search
QuickChanges
Forums
FAQ
Archives
Register
You are editing "How do I make a 'not equal to' statement in MySQL?"
Who can edit an FAQ?
Anyone registered may edit an FAQ.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
There are a number of ways to do this. Use: WHERE 'something' <> 'something_else' or: WHERE 'something' != 'something_else' As they are identical. or you can specify a number of values you don't want to be return from your column/field (my_tablein this example) - a more efficient way of doing things if you have a lot of values: WHERE my_table NOT IN ('something', 'something_else'); ----------------------------- Relevant links: [url=http://www.geocrawler.com/mail/thread.php3?subject=select+problem+with+%22not+equal%22+syntax&list=8]select problem with "not equal" syntax[/url] [url=http://www.mysql.com/doc/en/Comparison_Operators.html]Comparison Operators[/url] [url=http://developer.sapien.net/mysql_pkt_ref/]Mysql Pocket Reference[/url] [url=http://www.juicystudio.com/tutorial/mysql/select.html]Using the SQL SELECT Statement with MySQL[/url] [url=http://www.perlscriptsjavascripts.com/tutorials/mysql/]Using MySQL with Perl[/url] ----------------------------- Relevant notes: At the time of writing this FAQ was ranked number [b]1[/b] at Google for the terms [url=http://www.google.com/search?q=sql+statement+using+not+equal+to]sql, statement, using, not, equal, to[/url] and 7 for [url=http://www.google.com/search?q=sql+not+equal]sql, not, equal[/url] . ______________________ [internallink=4626]Emperor[/internallink] [small][i](Added by: [url=http://www.ozoneasylum.com/cgi-bin/ubbmisc.cgi?action=getbio&UserName=Emperor]Emperor [/url] on Fri 08-Nov-2002)[/i][/small] [small][i](Edited by: [url=http://www.ozoneasylum.com/cgi-bin/ubbmisc.cgi?action=getbio&UserName=Emperor]Emperor [/url] on Thu 01-May-2003)[/i][/small]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »