Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Distinct with Alpha based colums?

Author  Topic 

Eagle_f90
Constraint Violating Yak Guru

424 Posts

Posted - 2008-01-07 : 12:48:19
In my table I list the name of many different games and the names are not unique, so the same name could appear in many different rows. I know that distinct can be used to eliminate duplicates in a column but I am only familiar with using it in th count() command. Can it be used in just a normal select statement or is there a command like it that I can throw into a select statement to get only unique values?

--
If I get used to envying others...
Those things about my self I pride will slowly fade away.
-Stellvia

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-01-07 : 12:53:16
You can use

SELECT DISTINCT gamename
FROM YourTable
Go to Top of Page

Eagle_f90
Constraint Violating Yak Guru

424 Posts

Posted - 2008-01-07 : 13:51:18
Great, thanks!

--
If I get used to envying others...
Those things about my self I pride will slowly fade away.
-Stellvia
Go to Top of Page
   

- Advertisement -