Thread: Items by Era
View Single Post
  #2  
Old 09-13-2014, 05:15 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,603
Default

I assume you could filter using JOINs on the loot and zone tables to pull only stuff from certain expansions based on the expansion column in the zone table. Keep in mind, this query is huge, so it takes forever to run, especially since it's pulling based on EVERY zone in an expansion.

Code:
SELECT DISTINCT i.* 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 lt.`id` = lte.`loottable_id`
INNER JOIN npc_types n ON n.`loottable_id` = lt.`id`
INNER JOIN spawnentry se ON n.`id` = se.`npcID`
INNER JOIN spawn2 s2 ON se.`spawngroupID` = s2.`spawngroupID`
INNER JOIN zone z ON s2.`zone` = z.`short_name`
WHERE z.`expansion` = '#'
ORDER BY lde.`item_id` ASC LIMIT 1000;

Last edited by Kingly_Krab; 09-13-2014 at 05:20 PM..
Reply With Quote