Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Optimized query to return multiple values in one field

Status
Not open for further replies.

sodakotahusker

Programmer
Mar 15, 2001
601
I have to return a recordset combining a many to one relationship so I fill one field with a list of the values in the many side of the equation.

So I want to bring back something like this

'Football',1997,'punt,pass,kick'
'Basketball',2001,'15,22,18,51,55'

Looping through with a cursor or reading a temp table would be not be performance oriented. How can I pull together a list with embedded selects?

Something like ' select a,b,(select c ... to return the list) I have isolated the required fields in a view with just the distinct values and the id from the master record.

 
thread183-1159740

hope it helps,

Alex

[small]----signature below----[/small]
Now you can go where the people are one!
Now you can go where they get things done!
 
Dang. That thread was longer than War and Peace, well, at least longer than the peace part. Should do the trick.
Thanks so much.
 
Weird how that sometimes happens, huh?

-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
At least this one won't get so long :-D

[small]----signature below----[/small]
Now you can go where the people are one!
Now you can go where they get things done!
 
You should see how long some threads can get. That thread was nothin'.
 
the longest I can remember was 285 posts and still growing but that *was* in the history forum...

--------------------
Procrastinate Now!
 
277 to go! [rofl]

[small]----signature below----[/small]
Now you can go where the people are one!
Now you can go where they get things done!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top