List distinct tuples in a table(SQL query)(10 ways)

database, sql

Solution

Here's four.

`GROUP BY <all_columns>`

`SELECT * FROM T INTERSECT SELECT * FROM T`

`SELECT * FROM T UNION SELECT * FROM T`

`SELECT * FROM T EXCEPT SELECT * FROM T WHERE 1 = 0`

Problem

What are the different ways of listing distinct tuples in a table, the original question from GOLDMAN SACHS says to list 10 different ways one such way is using DISTINCT . Can anybody help me with more..

Original source