I want to delete multiple records at once.
I have two tables, one that contains
comments: comment_id, comment, author_id
news_comments: news_id, comment_id
I want to delete all records from the news_comments where author_id = 1 in the comments table.
I tried doing this, but it gave me an error about the sub query returning more than one item:
delete from news_items where comment_id =
(select comment_id from comments where author_id = 1)
delete from news_items where comment_id IN
(select comment_id from comments where author_id = 1)
^^
IN
try this
delete from news_items where comment_id in
(select comment_id from comments where author_id = 1)