Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
dba123
Yak Posting Veteran
90 Posts |
Posted - 2005-12-16 : 00:24:00
|
| Let's say I do a select statement and the results areAcct # Zip Phone Addr11223 23232 333-444-5555 6556 Duns Rd.12345 34343 222-444-3333 1000 Aspire Blvd.I need to create a record into a final table using the Acct # and column for each column as well as append some other values like this11223 23232 othervalue1 othervalue211223 333-444-5555 othervalue1 othervalue211223 6556 Duns Rd. othervalue1 othervalue212345 34343 othervalue1 othervalue212345 222-444-3333 othervalue1 othervalue212345 1000 Aspire Blvd. othervalue1 othervalue 2How do I do this for each row in my result set? |
|
|
surendrakalekar
Posting Yak Master
120 Posts |
Posted - 2005-12-16 : 00:37:01
|
| Not clear but try this.Select str([acct #]) + space(1) + OtherValue1 + space(1) + othervalue2 from yourtable where ....Surendra |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-12-16 : 01:20:04
|
| Where do you want to show these data?>>Select str([acct #]) + space(1) + OtherValue1 + space(1) + othervalue2 from yourtable where ....Str will unnecessarily add leading and trailing spacesselect str(10)+str(12)MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|