View Single Post
  #12  
Old 10-30-2006, 12:22 PM
sesmar
I built it I will Support it!
 
Join Date: Jun 2005
Location: Michigan
Posts: 214
Default

Quote:
Originally Posted by Angelox
Trick is, how do you figure out what is the loot in use, and what is not, so it can be removed?
This query will tell you all Loottables that are not assigned to a NPC.

Code:
SELECT
  npc_types.id,
  lootdrop.id
FROM
  npc_types
  RIGHT JOIN lootdrop
    ON lootdrop.id=npc_types.loottable_id
WHERE
  npc_types.id IS NULL
Warning this query will take a little bit of time to run, for some reason MySql does not like right joins looking for nulls but it will work and will give you the desired information.
__________________
Reply With Quote