Your question was already answered by the other posters, I'd just like to point out that
delete from table where id <> 2
(or variants thereof, not id = 2 etc) will not delete rows where id is NULL.
If you also want to delete rows with id = NULL:
delete from table where id <> 2 or id is NULL