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

Concatenate content into one column 1

Status
Not open for further replies.

yan19454

MIS
May 19, 2005
94
US
I have the following info.

I need to update table OutPatientMedStat

from those records
PNO CPTCode
40000028 80061
40000028 83735
40000028 84100
40000028 84436
40000028 84443
40000028 84479
40000028 84480
40000028 85025
40000028 86617
40000028 86618
40000027 86617
40000027 86615
40000027 86612

What I need to accomplish it. PUt one into PCPTCode, the rest I will Concatenate the other CPTCode and put into OtherPCPCode column.

In the vb, I need to loop through the record. I do not how to accomplish this in SQL. Thx.

PNO, PCPTCode, OtherPCPCode
40000028 80061 8373584100841008443684443447984480850258661786618
40000027 86615 8661786617

I have more than 15,000 records in the table which need to fill out the data.
 
you cannot do this easily in SQL

which database are you using? there are different techniques for each one

for example, in MySQL, it's trivial, but in other databases it's like a root canal

r937.com | rudy.ca
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top