SQL refining operator

AuthorHariom Prajapati

Pubish Date03 Jul 2022


1) SQL Distinct Statement

The select distinct statement use to search unique data from a table.

If two data are same then it show only one data.


Syntax - 

select distinct column_name from table_name;


Note:- This statement must have one column name because it shows distinct (unique) value. If you give two column name then it not give unique values as shown in the below figure.

2) SQL Order By Keyword 

The order by keyword use to set the data of a table in an ascending or descending order.

  • Use asc for ascending order.
  • Use desc for descending order.


Syntax -

select column1_name, column2_name, ...
from table_name
order by column1_name, column2_name, ..... asc | desc;

Note:- If you do not mention asc or desc then it shows data in ascending (asc) order by default.


3) SQL Limit Keyword

The limit keyword use to search any data from the column with any limitation.


Syntax -

select * from table_name limit range;