dhope Posted January 17, 2011 Share Posted January 17, 2011 Hi, I am trying to create a table from information in my database but I dont want to include certain records. So far I have got: SELECT * FROM areas GROUP BY county ORDER BY county_category Is there way to say select all from areas but if county is equal to "xxxx", dont include this recored? I'm sure there is an easy way of doing this but I can't seem to work it out, please can someone point me in the right direction. I hope this makes sense Link to comment https://forums.phpfreaks.com/topic/224715-mysql-is-there-a-dont-include/ Share on other sites More sharing options...
bh Posted January 17, 2011 Share Posted January 17, 2011 Hi, SELECT * FROM areas WHERE county != 'xxxx' GROUP BY county ORDER BY county_category; or http://dev.mysql.com/doc/refman/5.0/en/comparison-operators.html#function_not-in Link to comment https://forums.phpfreaks.com/topic/224715-mysql-is-there-a-dont-include/#findComment-1160671 Share on other sites More sharing options...
dhope Posted January 17, 2011 Author Share Posted January 17, 2011 Worked a treat, thank you bh. Link to comment https://forums.phpfreaks.com/topic/224715-mysql-is-there-a-dont-include/#findComment-1160714 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.