How do you select multiple columns from a table while ensuring that one specific column doesn't contain duplicate values?
SELECT DISTINCT col1,col2,col3,col4 from table
This doesn't work, because DISTINCT here applies to all columns so columns as a whole are distinct. But I want a single column to have distinct values.
"TeamViewer is the fast, simple and friendly solution for remote access over the Internet"
Regarding the "friendly" description, has is stopped unceremoniusly booting your session after a couple of minutes accusing you of using it in a commercial environment?!
I hate religious supremacist genocidal maniacs. How antisemitic of you to imply that's what all Jews are like. Still no links I see. I guess when you're a zionists, backing your claims with proof doesn't matter. bEliEvE mE oR yOuRe hItLeR.
Question
Code149
How do you select multiple columns from a table while ensuring that one specific column doesn't contain duplicate values?
This doesn't work, because DISTINCT here applies to all columns so columns as a whole are distinct. But I want a single column to have distinct values.
I'm using SQL Server. :)
Link to comment
https://www.neowin.net/forum/topic/974024-sql-select-multiple-columns-with-only-one-distinct-column/Share on other sites
6 answers to this question
Recommended Posts