0
微型優化我知道,這更多是因爲我很好奇。從一個查詢中具有公共列的多個表中刪除?
我有兩個鏈接表,
blog_categories_posts => post_id, category_id
blog_tags_posts => post_id, tag_id
我除去基礎上,post_id
兩個表的各個環節:
DELETE FROM blog_categories_posts WHERE post_id = {$id};
DELETE FROM blog_tags_posts WHERE post_id = {$id};
無論如何,我想知道是否有可能從兩者中刪除桌子一次,以及它會是一次表演(雖然微)打或增益?
我想象,如果它是一個工作:
DELETE FROM blog_categories_posts, blog_tags_posts where post_id = {$id}
或類似的語法?
還有另一個像我發現的問題,也許它會幫助? http://stackoverflow.com/questions/3331992/how-to-delete-from-multiple-tables-in-mysql –