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

Merge rows via SQL

Status
Not open for further replies.

dax1

MIS
Nov 18, 2002
8
0
0
CA
Hello

I have a table made up of 3 columns, these being

REP = Report Number
LINE = Line Number in the report
TXT = Text


My table has some 2000 records and I would like to group it by report number (about 336 reports in all). This requires that I merge (concatonate) the TXT field

Ex:

REP LINE TXT
122 01 Text of report
122 02 Cost distribution
122 03 annual analysis

I would like to return an SQL query that gives me the following

REP TXT
122 Text of report Cost distribution annual analysis

My Union select query does not return the results merged it always returns the 1st & 3rd columns as originally shown.

Any advice would be kindly appreciated. Thank you in advance

Dax1









 
Worked perfectly.

Thank you for the help.

Kind regards

Dax1
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top