Where cell is not equal to.. MySQL query (!=) [closed]
Can someone tell me how I can do a MySQL query that selects all row with an id != 1?
Please give me example of it.You didn't provide much detail, but it seems your own title answers the question: use WHERE id != 1
. It works in MySQL, but the SQL standard is <>
, not !=
.
In standard ANSI SQL, not equal is represented as: <>
Try this one:
SELECT * FROM pages WHERE id <> 1
You also can use !=
instead of <>
SELECT * FROM pages WHERE id != 1
Use <>
or !=
, both works for MySQL
精彩评论