Is there a MySQL statement which is the equivelent of " !== " in PHP. I want to select everything UNLESS it has a particular ID number.
Thanks,
| SitePoint Sponsor |



Is there a MySQL statement which is the equivelent of " !== " in PHP. I want to select everything UNLESS it has a particular ID number.
Thanks,
Regards, Ant.




WHERE ID <> [the_excluded_id]
<> to SQL is
!= to PHP
S





!= works as well although I think <> is the ANSI SQL standard way of NOT EQUAL TO.
Matt - Sybase DBA / PHP fanatic
Sybase/MySQL/Oracle | I don't like MySQL
Download Sybase | DBForums.com - for all your RDBMS talk
And if you really want the MySQL way to do !== I think it's IS NOT NULL.![]()
that's only to test if something's not NULL.it only compares a value to NULL. if you want to compare 2 non-NULL values, use =, <>, !=, or the NULL-safe version of =, <=>. e.g.
Code:mysql> SELECT NULL=NULL; +-----------+ | NULL=NULL | +-----------+ | NULL | +-----------+ mysql> SELECT NULL<=>NULL; +-------------+ | NULL<=>NULL | +-------------+ | 1 | +-------------+
- Matt
Dr.BB - Highly optimized to be 2-3x faster than the "Big 3."
"Do not enclose numeric values in quotes -- that is very non-standard and will only work on MySQL." - MattR
Bookmarks