UPDATE With Multi JOINS In a Single Query

30 Views Asked by At

I am trying to JOIN 4 Tables in one query, it compiles okay, but returns or SET no values. Following is The QUERY i have written. A Little help Please

UPDATE tbl_venue_charges AS VC
  JOIN tbl_usr_training_master AS TM ON TM.trai_master_id = VC.vnu_chrg_id
  JOIN tbl_trainer_participant_expenses AS TPE ON TPE.trpex_id = VC.vnu_chrg_id
  JOIN tbl_usr_training_master2 AS UTM ON UTM.trai_master2_id = VC.vnu_chrg_id
  JOIN tbl_travelling_expenses AS TEX ON TEX.trv_exp_id = VC.vnu_chrg_id

  SET VC.trai_master_id = TM.trai_master_id AND
      VC.trpex_id = TPE.trpex_id,
      VC.trai_master2_id = UTM.trai_master2_id,
      VC.trv_exp_id = TEX.trv_exp_id;
0

There are 0 best solutions below