christer99
IS-IT--Management
- Dec 3, 2001
- 247
How would I insert multiple records from one table into one field/column into another table. When I ran the query below I am only get the first value inserted and not all of them
update roundingtype
set pccodes = pccodes+' '+ a.type from (
SELECT top 500 TYPE
FROM POLICY
WHERE (TYPEGROUP = 'PC') AND (STATUS IN ('NEW', 'REN', 'END', 'REW')) AND (RIGHT(EXP, 2) IN ('A5', 'A6', 'A7'))
GROUP BY TYPE
ORDER BY TYPE) a
update roundingtype
set pccodes = pccodes+' '+ a.type from (
SELECT top 500 TYPE
FROM POLICY
WHERE (TYPEGROUP = 'PC') AND (STATUS IN ('NEW', 'REN', 'END', 'REW')) AND (RIGHT(EXP, 2) IN ('A5', 'A6', 'A7'))
GROUP BY TYPE
ORDER BY TYPE) a