最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

use SQL to delete rows from 2 table DBeaver - Stack Overflow

programmeradmin0浏览0评论

i have 2 tables:

  • books b1
  • price p1

i want to remove rows from both tables using the following query:

DELETE books FROM price p1 JOIN books b1
ON b1.BOOK_ID = p1.ID WHERE p1.ISBN IS NOT NULL AND p1.VALUTA = 'yen'
AND b1.YEAR BETWEEN 2011 AND 2014

but i get the error:

An unexpected token "price" was found following "books FROM" expected token may include "JOIN"

I think i am following the correct order.

DELETE (choose 1 of the 2 tables)

then FROM(the other table)

followed by JOIN(the first table again)

what am i doing wrong?

发布评论

评论列表(0)

  1. 暂无评论