Avatar of Aleks
Aleks
Flag for United States of America asked on

left join question .. is there another way ?

Ill try explain in simple terms.

Table A is Cases
The ID is id

Table B is CaseComments
The join would be in :  casecomments.caseid = cases.id

The thing is that for each case there might be several case comments, if I do a query and do a left join to case comments from cases then I will get one recordset for each comment, which is not what I need. What I need is to display all comments in a column. So that I end up with something like:

Caseid, case number, process, etc .. , [CASECOMMENTS] (All of them separated by a dash or whatever, in one column)
Next record &. Etc

Is it possible to do this with SQL ?

Appreciate your help.
Web DevelopmentASPSQL

Avatar of undefined
Last Comment
Aleks

8/22/2022 - Mon
peter57r

It will depend on which database you are using.
ToddBeaulieu

You want to concatenate rows. There are different approaches. Here's an article on it.

http://www.projectdmx.com/tsql/rowconcatenate.aspx
Aleks

ASKER
MS SQL 2000
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
Aleks

ASKER
I appreciate the help so far, unfortunately this is kind of urgent not sure if I have time to read, understand, learn how to concatenate and then use for this query by deadline .. if someone can help me with the code to concatenate with the information above that would be great.
ToddBeaulieu

I've got my own workload, too, but I'm sure someone here will step up and code it for you. Good luck.
Aleks

ASKER
Thanks ...
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
D B

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Aleks

ASKER
Ill try it tonight, thanks !