I have a query that is looking in many different tables and I am trying to see if there is a way to retrieve the data below so that it removes duplicates but puts the values that are not dupilicate in the same cell with a comma delimiter.
Tables:
Name.......Code....Well....Project
ST10959....16027...H1......one
ST10950....16027...A2......two
KB106832...5410....B2......three
KB106832...15678...B2......three
KB106832...13069...B2......three
U15527.....15410...C2......four
U15527.....15768...C2......four
KB106832...5410....D2......five
KB106832...15678...D2......five
This is the way the table looks (see above)
there are more than one codes for each project.
I want to return the codes but without all the information.
Is there anyway in sql to return the table like this or something similar to this:
Name.......Code....................Well...Project
ST10959....16027...................H1.....one
ST10950....16027...................A2.....two
KB106832...5410,15678,13069...B2.....three
U15527.....15410,15768...........C2......four
KB106832...5410,15678............D2......five
Tables:
Name.......Code....Well....Project
ST10959....16027...H1......one
ST10950....16027...A2......two
KB106832...5410....B2......three
KB106832...15678...B2......three
KB106832...13069...B2......three
U15527.....15410...C2......four
U15527.....15768...C2......four
KB106832...5410....D2......five
KB106832...15678...D2......five
This is the way the table looks (see above)
there are more than one codes for each project.
I want to return the codes but without all the information.
Is there anyway in sql to return the table like this or something similar to this:
Name.......Code....................Well...Project
ST10959....16027...................H1.....one
ST10950....16027...................A2.....two
KB106832...5410,15678,13069...B2.....three
U15527.....15410,15768...........C2......four
KB106832...5410,15678............D2......five