Hello frnds,
I am trying to select and updat the same table. example:
Frist table:
SQL> select * from t_1;
NO F BKAC_SID
---------- ---------- ----------
1 f1
2 f2
3 f3
second table:
SQL> select * from bkac;
NO F ORDR BKAC_SID
---------- ---------- ---------- ----------
1 f1 10 1111
2 f1 20 1111
3 f2 100 2111
4 f2 200 2110
Now, I need to Update bkac_sid in "t_1" table.
Matching condition is on "F" and update the minimum order obtained.
SQL> select min(ordr) from bkac where f = 'f1';
MIN(BKAC_SID)
-------------
10
For order number 10, bkac_sid = 1111
UPDATE table t_1:
SQL> select * from t_1;
NO F BKAC_SID
---------- ---------- ----------
1 f1 1111
2 f2
3 f3
I just want to write one update statement.