2个表,如何删除某字段相同的数据,SQL怎么写啊tableA 和tableB,俩个表的都有title字段,而且里面有重复的title字段的数据,
现在要同通过判断相同,删除tableA表 title字段相同的数据~

解决方案 »

  1.   

    delete from tableA where title in (select a.title from tableA a join tableb b on a.title = b.title)
      

  2.   

    delete a.* from tableA a
    inner join tableB b on a.title=b.title
    where 1
      

  3.   

    需求不明 a表的title要是和b表中的多条数据重复怎么办?也是删除?
      

  4.   

    delete from userss 
    where name  in (select  name  from userss  group  by  name   having  count(name) > 1)