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.
I don't know why someone said useless, but it does have that pesky kernel driver bundled, and it's in perennial turmoil. When it goes bad, it goes very bad, and it's impossible to predict when it will due to system differences. I know that they're in the middle of development for a major new version that will include a completely new driver, one that they expect will largely solve the problem, but that's a ways out and it's unproven at this point.
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