AndieB Posted April 18, 2008 Share Posted April 18, 2008 Hi all, I have a black-out... what is the syntax for quering a table and exlude something... ie. query table "country" and exclude all rows that is equal to "Sweden". I've lost it all in my head... Sincerely, Andreas Link to comment https://forums.phpfreaks.com/topic/101688-solved-exclude-in-a-query/ Share on other sites More sharing options...
fenway Posted April 18, 2008 Share Posted April 18, 2008 You mean != ? Unless it's via a LEFT JOIN.. IS NULL. Link to comment https://forums.phpfreaks.com/topic/101688-solved-exclude-in-a-query/#findComment-520295 Share on other sites More sharing options...
ergecs Posted April 18, 2008 Share Posted April 18, 2008 SELECT * FROM `countries` WHERE name NOT IN ('Sweden') OR SELECT * FROM `countries` WHERE name != 'Sweden' Link to comment https://forums.phpfreaks.com/topic/101688-solved-exclude-in-a-query/#findComment-520298 Share on other sites More sharing options...
AndieB Posted April 28, 2008 Author Share Posted April 28, 2008 Thank you!! Link to comment https://forums.phpfreaks.com/topic/101688-solved-exclude-in-a-query/#findComment-528735 Share on other sites More sharing options...
fenway Posted April 28, 2008 Share Posted April 28, 2008 No index usage... be careful. Link to comment https://forums.phpfreaks.com/topic/101688-solved-exclude-in-a-query/#findComment-528829 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.