I've got an error to store a new procedure in phpMyAdmin. I am trying to insert this code (with MySQL) as a new procedure:
UPDATE a
SET a.firstname = b.firstname,
    a.lastname  = b.lastname,
    a.sex       = b.sex 
FROM stagingtable b
JOIN tbl_syncList a ON a.idcolumn = b.idcolumn
WHERE b.timestamp > a.timestamp
INSERT tbl_syncList(firstname, lastname, sex, dateOfBirth, email)
SELECT 
    b.firstname,
    b.lastname,
    b.sex,
    b.dateOfBirth,
    b.email
FROM stagingtable b
LEFT JOIN tbl_syncList a ON a.idcolumn = b.idcolumn
WHERE a.idcolumn IS NULL
I am getting this error: #1064, synthax error, check manual for synthax to use near "FROM stagingtable b JOIN tbl_syncList a ON a.idcolumn = b.idcolumn WHERE (etc.)... on line 5
Any ideas what is wrong? Thanks a lot for your help!