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

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

javascript - return highlighted cells to php -

java - Creating a room by reading from a file (for a game) -