Face Posted December 16, 2005 Share Posted December 16, 2005 Hi, I've got a column (serialcat) in table (serial) which contains a combination of characters - axzyodu. These characters could be in any order for each row. What I want to do is to display all rows that contain 'o' or 'd' but not 'y' in the serialcat column. So I'd expect back examples of : axdo xuod zoda oax xdu etc..... Any help appreciated. Thanks. Link to comment https://forums.phpfreaks.com/topic/3061-include-and-exclude/ Share on other sites More sharing options...
fenway Posted December 23, 2005 Share Posted December 23, 2005 You can use regular expressions to accomplish your task: SELECT serialcat FROM serial WHERE serialcat REGEXP '[od]' AND serialcat NOT REGEXP 'y' Hope that helps. Link to comment https://forums.phpfreaks.com/topic/3061-include-and-exclude/#findComment-10350 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.