首頁 >後端開發 >php教程 >删除两个表中的数据 如何删除不了

删除两个表中的数据 如何删除不了

WBOY
WBOY原創
2016-06-13 10:17:51970瀏覽

删除两个表中的数据 怎么删除不了
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 code
DELETE `liao_addonarticle`,`liao_archives` FROM `liao_addonarticle` LEFT JOIN `liao_archives` ON liao_addonarticle.aid=liao_archives.id WHERE liao_addonarticle.body=''<div class="clear">
                 
              
              
        
            </div>
陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn