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.
| Author |
Topic |
|
xrum
Yak Posting Veteran
87 Posts |
Posted - 2010-05-17 : 13:34:38
|
| hi,i need to get a list of distinct cities from a database and an ID.Though each record has it's own ID, any ID correcsponding to that city will do...i tried this:SELECT distinct city FROM tblEvent ORDER BY city which gives me the locations as needed, but when I add the ID to the query it gives me everything (not just the distinct locs)SELECT distinct city , id FROM tblEvent ORDER BY city how can i get distinct cities out of the database, but only have 1 corresponding ID with it?Thanks! |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
xrum
Yak Posting Veteran
87 Posts |
Posted - 2010-05-17 : 13:42:29
|
| thanks |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|
|