DISTINCT keyword is used to remove duplication of rows from result set - Database

Q.  Which SQL keyword is used to remove the duplication of rows from the result set?
- Published on 26 Aug 15

a. DELETE
b. SELECT
c. DISTINCT
d. UNIQUE

ANSWER: DISTINCT
 

    Discussion

  • Nirja Shah   -Posted on 03 Nov 15
    DISTINCT
    - This command is used when the result set from a SELECT statement contains duplicate rows and you want to remove them and keep every row data to be unique for a column or combination of columns.

    - You can use the DISTINCT or DISTINCTROW identifier to eliminate duplicate records.

    - DISTINCT and DISTINCTROW are synonyms and specify removal of duplicate rows from the result set.

    UNIQUE
    - This constraint uniquely identifies each record in a database table.

    - The UNIQUE and PRIMARY KEY constraints both provide a guarantee for uniqueness for a column or set of columns.

    - A PRIMARY KEY constraint automatically has a UNIQUE constraint defined on it.

    SELECT
    - This statement is used to select data from a database.

    DELETE
    - This statement is used to delete records in a table.

Post your comment / Share knowledge


Enter the code shown above:
 
(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)