oracle - Sql update Query -
oracle - Sql update Query -
i got question i'm not sure can complete. follows: 'using single query update 4 smallest client id male.' i'm using oracle. uncompleted code below:
create table customer_09 ( custid varchar(5)primary key not null, firstname varchar(20), lastname varchar(20), dob date, address1 varchar(40), address2 varchar(40), phone varchar(7) ); update customer_09 set gender = 'male' custid = (select min(custid) customer_09)
if has right code, share me please.
thank you
when using rownum
limit result, cannot done within same "level" order done (because rownumbers assigned before order done).
so right solution this:
update customer_09 set gender = 'male' custid in (select custid ( select custid, rownum rn customer_09 order custid ) rn <= 4)
sql oracle
Comments
Post a Comment