Basically Unique and Distinct both are same means both do the same work , Unique statement was used earlier by the oracle database but Now a days Distinct statement is using by the oracle ( Now it is the official keyword ) , Though Unique statement is also exist .
select unique col_name from table_name ;
SQL DIstinct Statement
Distinct also do the same work .
Syntax
select Distinct col_name1 , col_name2 from table_name ;
Example ->
**Student_name** **Student_Age** **Student_Id**
Mukesh 23 1
Ayush 25 2
Ravi 25 3
Now I want to retrieve data which has distinct age so i can do with Distinct statement .
select distinct Student_Age from student ; // Output -> Mukesh 23 1
0 Comment(s)