Select distinct from multiple fields using sql
Posted
by Bryan
on Stack Overflow
See other posts from Stack Overflow
or by Bryan
Published on 2009-02-13T17:13:51Z
Indexed on
2010/04/15
15:33 UTC
Read the original article
Hit count: 399
I have 5 columns corresponding to answers in a trivia game database - right, wrong1, wrong2, wrong3, wrong4
I want to return all possible answers without duplicates. I was hoping to accomplish this without using a temp table. Is it possible to use something similar to this?:
select c1, c2, count(*) from t group by c1, c2
But this returns 3 columns. I would like one column of distinct answers.
Thanks for your time
© Stack Overflow or respective owner