0

For the following SQL query,

CREATE PROCEDURE addPayments()
BEGIN
       INSERT INTO payment (pay_date, salary_amount, employee_id)
       SELECT curdate(), designation.salary, employee.id
       FROM employee   LEFT INNER JOIN designation
       ON employee.designation_id=designation.id;
END

I received this error.

"Left" is not valid at this position, expecting ';'

Can anyone please point out What am i doing wrong here? and correct the statement :)

Followed this example

Yazeer
  • 36
  • 1
  • 4

1 Answers1

1

there is no such thing as an LEFT INNER JOIN they are always LEFT OUT JOIN

DELIMITER $$
CREATE PROCEDURE addPayments()
BEGIN
       INSERT INTO payment (pay_date, salary_amount, employee_id)
       SELECT curdate(), designation.salary, employee.id
       FROM employee LEFT JOIN designation
       ON employee.designation_id=designation.id;
END
nbk
  • 45,398
  • 8
  • 30
  • 47