Which SQL statement is used to return only different (non duplicate) values in a select statement?
-
Distinct
-
Primary key
-
Unique
-
Different
A
Correct answer
Explanation
There are situations where the values in a column are repeated. For example, the city column of a table can have many records of Mumbai, Delhi etc. To display the repeated values just once we can put the distinct clause with the where clause. For example, the statement select distinct(city) from list will display the name of a city only once. If the name of a city is present in the table more than once it will be shown just once.