CanMan2004 Posted February 3, 2007 Share Posted February 3, 2007 Hi all I've been trying to do a query which excludes a particular record, but cannot get it to work. Basically I have a table called "users" and I want to query this table, but excluding all records which have "happy" in the field "type". I have been trying to get this to work using <> but have no luck. My code is as follows SELECT * FROM `users` WHERE `access` = '2' AND `type` <> 'happy' Can anyone help? Thanks in advance Ed Link to comment https://forums.phpfreaks.com/topic/36909-query-select-excluding-record-x/ Share on other sites More sharing options...
hvle Posted February 3, 2007 Share Posted February 3, 2007 just a wild guess, you can try "not like" SELECT * FROM `users` WHERE `access` = '2' AND `type` not like '%happy%' Link to comment https://forums.phpfreaks.com/topic/36909-query-select-excluding-record-x/#findComment-176086 Share on other sites More sharing options...
CanMan2004 Posted February 3, 2007 Author Share Posted February 3, 2007 Thanks Link to comment https://forums.phpfreaks.com/topic/36909-query-select-excluding-record-x/#findComment-176366 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.