4

I try to increase John Smith salary by 10% and assume I don't know the emp_number for John Smith.

update m
    set m.mon_hourly_pay_rate = m.mon_hourly_pay_rate*1.1
from monthly_pay m
inner join Employee e
    on e.emp_number=m.emp_number
where e.emp_name = "John Smith";

Could anyone please help me. the word from have a red underline said "from" is not valid at this position, expecting: EOF, ";" but i google it and have not thing wrong with it

Cid
  • 14,968
  • 4
  • 30
  • 45
Thien Nguyen
  • 41
  • 1
  • 1
  • 5

1 Answers1

5

Your syntax is not correct. You need to use MySQL syntax as -

update monthly_pay m
       inner join Employee e
       on e.emp_number=m.emp_number
set m.mon_hourly_pay_rate = m.mon_hourly_pay_rate*1.1
where e.emp_name = "John Smith";
Ankit Bajpai
  • 13,128
  • 4
  • 25
  • 40