I am trying to find items that drop based on zone. Is there a more efficient method or way to write this? I'm tired and likely overlooking the most obvious way, but could some one point it out? :-\
Code:
SELECT DISTINCT i.id, i.name FROM items i
INNER JOIN lootdrop_entries lde ON i.id = lde.item_id
INNER JOIN loottable_entries lte ON lde.lootdrop_id = lte.lootdrop_id
INNER JOIN loottable lt ON lte.loottable_id = lt.id
INNER JOIN npc_types nt ON lt.id = nt.loottable_id
INNER JOIN spawnentry se ON nt.id = se.npcid
INNER JOIN spawngroup sg ON se.spawngroupid = sg.id
INNER JOIN spawn2 s2 ON sg.id = s2.spawngroupID
WHERE s2.zone = "frozenshadow";
-- spawn2 -> spawngroup -> spawnentry -> npc_type -> loottable -> loottable_entries -> lootdrop_entries -> items
-Hate