DiigIT | IT Community
No Profile Image
Welcome Guest
New User? Register | Login
SQL
IT Tags

Logical AND Operator

By: rekha singh | 28 Apr 2010 1:10 pm

Logical AND Operator 

The AND operator displays a record if both the first condition and the second condition is true.

 
It can be used in any valid SQL statement such as select,insert,update,or delete. the and operator requires that each condition must be met for the record to be included in the result set.
 
 
    syntax
 
    insert into table name where condition1 AND condition2
 
    update tablename set columnname values value where condition1 AND condition2
 
    delete from tabl name where condition1 AND condition2
 
    select from tablname where condition1 AND condition2
 
 
 
    EXAMPLE
 
    insert into sqldemo1 (id) values (23) where firstname='sam' AND pass='sam';
 
    Update sqldemo1 set id=34 where firstname='sam' AND pass='sam';
 
    Delete * from sqldemo1 where firstname='sam' AND pass='sam';
 
    select id from sqldemo1 where firstname='sam' AND pass='sam';
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Comments

No Comments Posted for this Article.

Leave a comment

Enter the text in the image
img
Can't read?
Type the characters you see in the picture below.


Close Move