query mysql in php to get the difference between two tables -


i have 2 tables same structure users finger print data , want first table data not exist in second table , insert second table structure of 2 tables:

  • id
  • user_id
  • check_time
  • check_type
  • sensor_id

you can use insert select from using additional join as

insert table2  select  t1.* table1 t1 left join table2 t2 on t1.user_id = t2.user_id , t1.check_time = t2.check_time t2.user_id null , t2.check_time null 

Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -