Can I make an update using common table expression in oracle database?
I am getting error ORA-00928: missing SELECT keyword when I am trying this:
ORA-00928: missing SELECT keyword
Since average salary just a scalar value you can do
average salary
update instructor set salary = case when salary <= (select avg(t.salary) from instructor t) then salary * 1.05 else salary * 1.03 end
In that case Oracle first compute the average (say 1234.4567) and then perform the update.
1234.4567