MySQL select rows that do not have matching column in other table

前端 未结 3 1580
南笙
南笙 2020-12-13 13:21

I can\'t seem to figure this out so far. I am trying to join two tables and only select the rows in table A that do not have a matching column in table B. For example, lets

3条回答
  •  悲&欢浪女
    2020-12-13 13:42

    May be this one can help you ....

    I had also the same problem but Solved using this this query

    INSERT INTO tbl1 (id,name) SELECT id,name from tbl2 where (name) not in(select name from tbl1);
    

    hope this one will solve your problem

提交回复
热议问题