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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subselect problem

Status
Not open for further replies.

ziziak

Programmer
Jul 13, 2007
11
SK
Hi all,

need help with sql cript.
let's have these rows:

Col1 Col2 ... Coln
1. Project1 Notes1 ...
2. Project1 Notes2 ...
......
10. Project1 Notes2 ...

and I need to get this result in one row :
Col1 Col2
1. Project1 Notes1,Notes2,Notes3....Notesn

how can I do that?

many thanx!
 
AFAIK there is no standard ANSI SQL way to do what you want.
Depending on your RDMS (you didn't mention) you have to write a SP or a function, or do the job programaticly in the presentation layer.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
this question should be asked in the forum for your particular database system

for instance, if you're on mysql, use the GROUP_CONCAT function, badda-bing, you're done, but if it's some other database, you may have to write a stored proc or summat

r937.com | rudy.ca
 
Rudy, is badda-bing a special keyword I was not aware of ? ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top