SQL - Avoid duplicates in the result of a SELECT query

March 2017




Issue


How to avoid duplicates in the results of a SQL query?

Solution

  • Simply use the DISTINCT clause and between the SELECT clause and the fields.
  • Example:
  • SELECT distinct id,name,surname FROM mytable
  • More informations available on this : Link

Related


Published by jak58.
This document, titled "SQL - Avoid duplicates in the result of a SELECT query," is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (ccm.net).