0 votes
1 view
in SQL by (20.3k points)

There are 2 tables, spawnlist, and npc, and I need to delete data from spawnlsit. npc_templateid = n.idTemplate is the only thing that "connect" the tables. I have tried this script but it doesn't work.

I have tried this:

DELETE s FROM spawnlist s

INNER JOIN npc n ON s.npc_templateid = n.idTemplate

WHERE (n.type = "monster");

1 Answer

0 votes
by (40.3k points)

Try adding .* to s in your first line of code like this:

DELETE s.* FROM spawnlist s

INNER JOIN npc n ON s.npc_templateid = n.idTemplate

WHERE (n.type = "monster");

Related questions

+3 votes
1 answer
asked Jul 3, 2019 in SQL by Tech4ever (20.3k points)
+2 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...