I have a query that returns a recordset that contains this kind of data:
Description Rate Amount
item1 2 .32
item2 3 1.34
item3 5 12.33
I want change the query to put all this data in ONE single field. What is the best why to do this?
Thanks!
What the result will look like in the ONE single field?
|||item1 2 .32 item2 3 1.34 item3 5 12.33
Just all these dumped into one field like above. However id like to use the final query in and update so i cant simply concatenate each field then each row and save it in a variable.
I have the query below but i cant use it in an update for multiple records without using a fetch, or at least I cant figure out a better way.
DECLARE @.blob varchar(2000)
SELECT
@.blob = ISNULL(@.blob,'') + (def.[description] + ' ' +
CAST(sd.amount as varchar(10)) + ' ' +
CAST(sd.minutes as varchar(10)) + CHAR(13) + CHAR(10) )
FROM
section_detail sd,
def_section_detail_description def
WHERE
sd.def_section_detail_descr_id = def.def_section_detail_descr_id
and sd.section_id = 2274893453
No comments:
Post a Comment