sql - Remove all rows Except condition -


i remove rows table except when firstname ben , isadmin true

here sql

delete table1 (firstname <> 'ben' , isadmin = 1); 

however, issue when isadmin false... should remove row doesn't remove it. issue here?

the correct sql should be

delete table1 (firstname <> 'ben' or isadmin = 0); 

Comments

Popular posts from this blog

php - Passing multiple values in a url using checkbox -

compilation - PHP install fails on Ubuntu 14 (make: *** [sapi/cli/php] Error 1) PHP 5.6.20 -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -