sql - Oracle PLSQL merge records within temporary table -
i have procedure in plsql fills temporary table. data looks following:
buyer_name quantity amount ------------------------------- john 10 1200 john 12 1310 alan 15 1450 alan 10 1200 john 20 2400
i need sum quantities , amount each buyer, remove existing data , fill table again such each buyer name comes once total quantity , amount.
i know can done if create temp table , transfer data through it. however, is there way can merge records within same temporary table (and within same session)?
it sounds problem here initil pl/sql procedure fills table. why not modify well? suspect answer makes use of pl/sql -- if so, make every effort convert sql instead, or turn pipelined function can select , aggregate output of.
that aside, aggregate result different table. assume these global temporary tables, there not overhead in doing direct path insert gtt more efficient modifying table in place.
Comments
Post a Comment