Machine-translated by Google. Questions are authored in English.
Top

Discussion

To remove duplicate rows from the results of an SQL SELECT statement, the ________ qualifier specified must be included.

  • A.ONLY
  • B.UNIQUE
  • C.DISTINCT
  • D.SINGLE

Answer: C

Correct answer: DISTINCT

SELECT DISTINCT removes duplicate rows from the result, comparing the whole selected row rather than any one column.

Note the cost: the engine must sort or hash the result to identify duplicates, so DISTINCT is not free on a large result set. It is also often a symptom rather than a fix - duplicates in a join usually mean the join condition is incomplete, and correcting that is better than filtering the result. UNIQUE is a constraint on a table, not a query qualifier.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.