Web Global Net Web Application & Web Development Project Center

Technical Issues => MySQL => Topic started by: admin on March 18, 2020, 01:48: PM



Title: Multiple Not = to elliminate from results
Post by: admin on March 18, 2020, 01:48: PM
I'm sure there are better ways to write the SQL but this works too.

Table fields enclosed in ` ` and the queries are enclosed in  " " Separate each not statement with an AND

SELECT *  FROM `events` WHERE `event_category_type` != 'Church'

AND `event_category_type` != 'Park'

AND `event_category_type` != 'Destination Location'

ORDER BY `event_category_type`  ASC


You can also eliminates this way

AND RIGHT(contact_email,11)!='noemail.com'