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 2000 Forums
 Transact-SQL (2000)
 Query help

Author  Topic 

esthera
Master Smack Fu Yak Hacker

1410 Posts

Posted - 2006-11-02 : 12:30:28
I have 3 fields in my table

date, place, name

Now there are multiple names for multiple dates and places.
I'm trying to query to pull all the names on each specific date and place.
(meaning a list where for nov 1 at place 1 -- and the list of names and then another list for nov 1 at place 2 and another list for nov 1 at place 3 and then for nov 2 at place 1.
Is there anyway to do this in an sql query?

KenW
Constraint Violating Yak Guru

391 Posts

Posted - 2006-11-02 : 12:52:17
[code]
select date, place, name order by date, place
[/code]

If this doesn't do what you want, post some sample data and the output you want.

Ken
Go to Top of Page

Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2006-11-02 : 13:13:02
Do you mean you want like a comma-seperated list of all the names, but one row per date/place?

If so, have a look at http://www.sqlteam.com/item.asp?ItemID=11021

Jay White
Go to Top of Page
   

- Advertisement -