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 |
|
mapidea
Posting Yak Master
124 Posts |
Posted - 2009-02-03 : 00:06:55
|
| Is this the right query for “Show me a list of cities, in alphabetical order, where our vendors are located, and include the names of the vendors we work with in each city.”select distinct vendorname, vendorcityfrom vendorsOrder by vendorcity ascThanks |
|
|
mapidea
Posting Yak Master
124 Posts |
Posted - 2009-02-03 : 00:08:48
|
| The above query returns vendorcity as many times it is there. |
 |
|
|
bklr
Master Smack Fu Yak Hacker
1693 Posts |
Posted - 2009-02-03 : 00:18:39
|
| if vendors are 4 in one city it will show the vendorname,vendorcity 4 times onlyif u want only cities then use select distinct vendorcity from vendors order by vendorcity asc |
 |
|
|
mapidea
Posting Yak Master
124 Posts |
Posted - 2009-02-03 : 00:23:38
|
| Thanks |
 |
|
|
bklr
Master Smack Fu Yak Hacker
1693 Posts |
Posted - 2009-02-03 : 00:51:18
|
quote: Originally posted by mapidea Thanks
welcome |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-02-03 : 09:25:38
|
quote: Originally posted by mapidea Is this the right query for “Show me a list of cities, in alphabetical order, where our vendors are located, and include the names of the vendors we work with in each city.”select distinct vendorname, vendorcityfrom vendorsOrder by vendorcity ascThanks
why dont you check this before posting as a question here? |
 |
|
|
|
|
|