問題A數(shù)據(jù)表欄位為 post_idB數(shù)據(jù)表的欄位為 urlA跟B都有很多數(shù)據(jù)A跟B有些 post_id 跟 url 是相符的 ,有些是不相符的 (A跟B有關聯(lián)性的字段是 post_id 跟 url )如何把不相符的都刪除?只留下有關聯(lián)性的DELETE a, b FROM
`a`
JOIN `b` ON b.ID != a.post_id這樣卻失敗了....?mariaDB 報錯誤:#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'JOIN b ON b.ID != a.post_id' at line 3然後又說a, b 這一段是預期以外的符號?PS:我要刪的是兩個資料表,只要都有不符合就刪除該筆我確定有 SELECT 到非常多不相符的數(shù)據(jù),也有相符的數(shù)據(jù)。a 的 post_id 有多個,例如b.ID 假如等於 123 那 a.post_id 有一個或多個123
mysql 刪除沒有該條件的數(shù)據(jù)?從其他數(shù)據(jù)表更新該資數(shù)據(jù)的值到另一個數(shù)據(jù)表?
慕桂英3389331
2018-10-24 12:31:41