Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Big Query Display result for data's that does not contain certain words

I have a big query data which contains 2 columns, MyText and SenderID. The tablename is mydatatable. I managed to filter the message list of rows that contain the word PIN or CODE in the MyText table id.

This was done like this:

SELECT * 
FROM `mydatatable` 
WHERE Mytext LIKE '%PIN%' OR Mytext LIKE '%CODE%'

How do we display the list of rows that do not contain the word "PIN" or "CODE"?

Thanks

like image 376
Shad Avatar asked Oct 26 '25 08:10

Shad


1 Answers

SELECT * FROM mydatatable WHERE NOT (Mytext LIKE '%PIN%' OR Mytext LIKE '%CODE%')
like image 107
Mikhail Berlyant Avatar answered Oct 29 '25 07:10

Mikhail Berlyant



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!