Java, Python, Database, Flutter, Matlap, Micorcontroller, Tutorials, Swing Framework

Hancie e-Learning Studio

Learn Java, Learn HTML, CSS, PHP, Javascript, Python Tutorials || Download program source codes || Java Project and Source code available here || All types error troubleshooting tips available here

MySQL AND, OR and NOT Operators

 

The MySQL AND, OR and NOT Operators

The WHERE clause can be combined with ANDOR, and NOT operators. The AND and OR operators are used to filter records based on more than one condition:

  • The AND operator displays a record if all the conditions separated by AND are TRUE.
  • The OR operator displays a record if any of the conditions separated by OR is TRUE.

The NOT operator displays a record if the condition(s) is NOT TRUE.

AND Example

SELECT * FROM Customers
WHERE Country = 'Bhadrapur' AND City = 'Birtamode';

OR Example

SELECT * FROM Customers
WHERE City = 'Pokhara' OR City = 'Kathmandu';

NOT Example

SELECT * FROM Customers
WHERE NOT Country = 'Nepal';

Combining AND, OR and NOT

SELECT * FROM Customers
WHERE Country = 'Nepal' AND (City = 'Bhadrapur' OR City = 'Damak');
Welcome all to Hancie e-learning studio
Friends,
I have brought an e-learning platform for you from where you can teach internet, website, programming language, error troubleshooting, etc. Blogger, WordPress templates, themes are available for free on this website, which are not charged for downloading, so that you can earn money by blogging using such templates and this is not a difficult task and this You can do it now. You keep uploading new posts by us and keep taking advantage of this website. The aim of which is to spread the knowledge related to internet, career, web designing and technology to the people and contribute to the development of the country.