Clauses in SQL SERVER:-
Different clauses in sql server
- Where
- Order by
- Distinct
- Group by
- Having
- With
- On
where clauses in sql server :-
- Where clauses is used to get particular records from the table based on a condition
Syntax: Select<collist>from<Tabname> where <condition>.
Condition in Where clause query:
- Colname operatior value: It must be relational (or) special operatior
- Display employeerecord whose empid=2
Select *from emp
Where empid=2
Order of declaration :- [user follows this one]
Means which clause
- Select
- From
- Where
- Group by
- Having
- Order by
Order of execution : – [system follows]
- From
- Where
- Group by
- Having
- Select
Display employee records earning more than 2000.
Select * from emp where sal>2000.
Display employee records earning more than 2000 and less than 5000
Select * from emp where sal>2000 and sal<5000