troubleshooting Question

Concatenate SQL rows in to one column

Avatar of Gareth_Pointon
Gareth_Pointon asked on
Microsoft SQL ServerASPMicrosoft SQL Server 2008
10 Comments1 Solution337 ViewsLast Modified:

I have two tables.

First holds the singe row information to be displayed.
JobID - Company - Site - Contact
11      - ASB         - site1- gazz
22      - HSA         - site2 - Joe

Second can either have one or more rows based on the filter from the first table.
JobID  -  first name  -  surname
11       -  Greg           -  Potter
11       -  Frank          -  Harrys
22       -  Dom           -  Davies

What I would like to happen is this:

JobID   -   Company   -    Site    -    Contact   -   Engineer
11        -   ASB           -   site1   -     gazz       -    Greg Potter - Frank Harrys
22        -   HSA           -   site2    -     Joe        -    Dom Davies

Can this be done?

I'm pulling this from SQP 2008 and using it in ASP so really need it as a view or something like that as this to be pulled via a Recordset.

Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 10 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 10 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros