EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Database/World Building (https://www.eqemulator.org/forums/forumdisplay.php?f=596)
-   -   More Efficient Method? (https://www.eqemulator.org/forums/showthread.php?t=36989)

Hateborne 06-21-2013 06:01 PM

More Efficient Method?
 
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


All times are GMT -4. The time now is 08:36 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.