Blog Details

AND & OR Operators



                                

* SQL AND & OR Operators :-

 
  • The AND & OR operators are used to filter records based on more than one condition.
  • The AND operator displays a record if both the first condition AND the second condition are true.
  • The OR operator displays a record if either the first condition OR the second condition is true.
 

AND Operator Example :

SELECT * FROM Customers WHERE Country='Germany' AND City='rajkot';  

OR Operator Example :

SELECT * FROM Customers WHERE City='Berlin' OR City='rajkot';  

Combining AND & OR

SELECT * FROM Customers WHERE state='gujrat' AND (City='Berlin' OR City='München');  


Categories

Php mysql

Latest posts

13.05.14
Implementing CRUD Operations ¶

<ul> <li>Now comes the fun part. We would like t

13.05.14
View

<ol> <li><a href="http://www.yiiframework.com/do

13.05.14
Creating Model

<ol> <li><a href="http://www.yiiframework.com/do

Get Free Quote