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
 General SQL Server Forums
 New to SQL Server Programming
 select from column once

Author  Topic 

disciple
Starting Member

27 Posts

Posted - 2006-03-29 : 23:28:43
How do I get all the entries in a column, but make it so that there is only one occurance of each unique item.

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-03-29 : 23:31:34
you can use DISTINCT or GROUP BY

select DISTINCT col1
from table1


or

select col1
from table1
group by col1




KH

Choice is an illusion, created between those with power, and those without.
Concordantly, while your first question may be the most pertinent, you may or may not realize it is also the most irrelevant

Go to Top of Page

disciple
Starting Member

27 Posts

Posted - 2006-03-29 : 23:32:37
That worked perfectly, thankyou very much
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-03-30 : 00:02:44
Also learn SQL
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

disciple
Starting Member

27 Posts

Posted - 2006-03-30 : 00:06:33
Thanks for the links, will be sure to check there before I post any other questions
Go to Top of Page
   

- Advertisement -