複数のレコードを一度に削除したい。
私は2つのテーブルを持っています。
comments: comment_id, comment, author_id
news_comments: news_id, comment_id
コメントテーブルのauthor_id=1であるnews_commentsからすべてのレコードを削除したいと思います。
これを試してみましたが、サブクエリが複数のアイテムを返すというエラーが発生しました。
delete from news_items where comment_id =
(select comment_id from comments where author_id = 1)