作者:年轻的周末我做主 | 来源:互联网 | 2017-05-14 01:43
删除两个表中的数据怎么删除不了SELECT*FROM`liao_addonarticle`,liao_archiveswhereliao_addonarticle.a是有数据出来的 我写了下面的两条语句都不行。该怎么改的呢?d
删除两个表中的数据 怎么删除不了
SELECT * FROM `liao_addonarticle`,liao_archives where liao_addonarticle.aid=liao_archives.id and liao_addonarticle.body='' 是有数据出来的
我写了下面的两条语句 都不行。 该怎么改的呢?
delete FROM `liao_addonarticle`,liao_archives where liao_addonarticle.aid=liao_archives.id and liao_addonarticle.body=''
delete from (SELECT * FROM `liao_addonarticle`,liao_archives where liao_addonarticle.aid=liao_archives.id and liao_addonarticle.body='')
------解决方案--------------------SQL codeDELETE `liao_addonarticle`,`liao_archives` FROM `liao_addonarticle` LEFT JOIN `liao_archives` ON liao_addonarticle.aid=liao_archives.id WHERE liao_addonarticle.body=''