I have following mySQL table:
ID Name Country Industry
1 Abc IN Computer Software
2 Xyz US Banking
3 Mno AU Business Services
4 Pqr FR Media
And I have following two lists:
Country = [US, IN, NL, SA, SL],
Industry = [Computer Software, Computer Hardware, Construction, Business Services, Electronics]
I need a mySQL query to perform following task:
Use this query
Select * from table_name where Country not in ('US', 'IN', 'NL', 'SA', 'SL') OR Industry not in ('Computer Software', 'Computer Hardware','Construction', 'Business Services', 'Electronics')
USE this
SELECT * FROM TABLE_NAME
WHERE
Country NOT FIND_IN_SET(Country , 'US, IN, NL, SA, SL')
OR NOT FIND_IN_SET(Industry, 'Computer Software, Computer Hardware, Construction, Business Services, Electronics')
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.