I have two mysql tables - a sales table:
+----------------+------------------------------+------+-----+---------+-------+ | Field | Type
We can use this:
INSERT INTO `test_table` (`id`, `name`) SELECT DISTINCT a.`employee_id`,b.`first_name` FROM `employee_leave_details`as a INNER JOIN `employee_register` as b ON a.`employee_id` = b.`employee_id`