Einträge von 2 Tabellen mit einer SQL Statement löschen in NexusDB

jackie05

Erfahrenes Mitglied
Hallo,
wie der Titel schon sagt, möchte ich mit einer SQL Statement 2 Tabellen ansprechen und bestimmte Einträge löschen in NexusDB.

Ich hab das mal so versucht:
SQL:
DELETE FROM articles AS a
INNER JOIN awarded AS b
ON a.id = b.article_id
WHERE a.id=1
oder damit:
SQL:
DELETE a, b FROM articles a
JOIN awarded b ON a.id = b.article_id
WHERE a.id = 1

leider klappt das nicht, wie könnte man das denn lösen?
Ich bedanke mich schon mal im Voraus.

Gruss
 
Warum machst du nicht ein Subselect?
SQL:
DELETE FROM articles a WHERE a.id IN (SELECT b.article_id FROM awarded b)
 

Neue Beiträge

Zurück