Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • SQL Unique/DIstinct Statement

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 314
    Comment on it

    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)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: