Knowledge Walls
Gopal Rao
Mumbai, Maharashtra, India
Passcode:
And query in sql server in Queries of SQL Queries
4100 Views
Hints 
"and" used to compare two column values in where condition.If both condition statisfy select command select the column which is related to that conditions.

In following example, where the project number and emp number statify the related empolyee number will be selected.
Syntax
select columnName from tableName where firstCondition and secondCondition;

//select the column where the both conditions are statisfied.
Example
Get the employee numbers for employees working in project p2,
and having employee numbers smaller than 10000.Solve this problem with
two different but equivalent SELECT statements.

select emp_no from Works_on where project_no='p2' and emp_no>10000;
  Copyright © 2014 Knowledge walls, All rights reserved
KnowledgeWalls
keep your tutorials and learnings with KnowledgeWalls. Don't lose your learnings hereafter. Save and revise it whenever required.
Click here for more details