Insert multiple rows
497581Jul 12 2006 — edited Jul 13 2006When I run the following query, I get the error message ORA-01427: single-row subquery returns more than one row.
insert into abc (id, code, detail)
values (ID_COUNT.nextval, (select distinct code from abc) , 'TOTAL AMOUNT').
I understand the error message, but I'm not sure how to make it work. There are about 200 distinct code from abc, and I don't want to manually insert rows for each distinct code.
Is there a way to modify the query and make it work?
Thanks!