Which SQL keyword is used to retrieve only unique values?
2024
Which SQL keyword is used to retrieve only unique values?
- A.
DISTINCTIVE
- B.
UNIQUE
- C.
DISTINCT
- D.
DIFFERENT
Attempted by 1579 students.
Show answer & explanation
Correct answer: C
Answer: Option C
Solution:
This command is used to select the distinct rows.
For Example: If we want to select all distinct department names from employee table, the query would be:
SELECT DISTINCT dept FROM employee;