SQL DISTINCT Statement
In table, we enter some value more than two times as for our need.But when we want to see only different value means one value only one time that time we use Distinct keyword.
Syntax:
selcect distinct * from table name
select distinct col_name1,col_name2 from table name
SQL Where Clause
In table where clause is used to filter records.
Syntax:
Select col_name1,col_name2 from table name where col_name operator value
Example:
Select s_name,s_marks from student[table name] where s_name='Amitesh'
select s_name,s_id from student where s_id=12
Some operator which is used by where clause that are following..
=,<, >, <>,<=,>=, Between, Like, In
Order By:
Order by keyword sort the records ascending order by default.If we want to sort the records in a descending order, we can use the desc keyword.
Syntax:
select * from table name order by col_name asc/desc
Example:
select * from student order by s_name desc
No comments:
Post a Comment