Welcome Guest, Not a member yet? Register   Sign In
Need help with Delete query
#1

[eluser]Leftfield[/eluser]
Hello! I need remove node with it all comments, first of all i made select query with JOIN:

Quote:SELECT * FROM pages as t1 LEFT JOIN comments as t2 ON t1.id=t2.entry_id WHERE t1.id = '1';
I dont know how to delete this selection
#2

[eluser]danmontgomery[/eluser]
Code:
DELETE FROM pages, comments USING pages LEFT JOIN comments ON comments.entry_id = pages.id WHERE pages.id = 1;
#3

[eluser]Leftfield[/eluser]
[quote author="noctrum" date="1285201489"]
Code:
DELETE FROM pages, comments USING pages LEFT JOIN comments ON comments.entry_id = pages.id WHERE pages.id = 1;
[/quote]
THANK YOU +5




Theme © iAndrew 2016 - Forum software by © MyBB