Quantcast
Channel: Question and Answer » oracle
Viewing all articles
Browse latest Browse all 717

using update query with subquery in Oracle sql

$
0
0

I have an update query where I am trying to update a field but for more than one record, I am trying a join but it doesn’t work. Below I get multiple values that come back from the select statement but I think my syntax is incorrect below.

UPDATE sku@bn2 x 
INNER JOIN (
   select g.prev_perm_ret, g.itm_cd
   from gm_prc_reg_prc_items g, sku@bn2 b
   where g.itm_cd=b.stylecode
   and b.storecode=00000
   and g.prev_perm_ret<>b.listprice
   and g.prev_perm_ret>g.ret_prc
   and b.sellprice=b.listprice
) y ON x.stylecode=g.itm_cd
SET x.listprice=y.prev_perm_ret

Viewing all articles
Browse latest Browse all 717

Trending Articles