INSERT from with a loop using MySQL
-
Hi, I have employee_benefits MySQL table with the following fields:
employee_benefit_id --- autonumber
employee_id
benefit_category
benefit_description
benefit_amountI want to loop through all records in the above table and insert the values into salary_slips table which has the following fields:
salary_slip_id --- autonumber
document_id ---- forget this it's just UUID
employee_id -- from employee_id in employee_benefits
slip_month -- from SP variable param_slip_month
slip_year -- from SP variable param_slip_yearand then I want to insert data into salary_slips_details:
salary_slip_details_id --- autonumber
salary_slip_id -- the id from salary_slips table
slip_details_description -- benefit_description from employee_benefits table
slip_details_amount -- benefit_amount from employee_benefits tableHow can I do this complicated query please? Thanks, Jassim
Technology News @ www.JassimRahma.com