Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Development > Archive::Database/World Building

Archive::Database/World Building Archive area for General Discussion's posts that were moved here after an inactivity period of 90 days.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #8  
Old 01-26-2004, 07:10 PM
Lurker_005
Demi-God
 
Join Date: Jan 2002
Location: Tourist town USA
Posts: 1,671
Default

Here, I just worked out the SQL to find NPC venders with empty item lists.
Code:
select id, name, merchant_id from npc_types left join merchantlist on merchant_id = merchantid where merchant_id <> 0 and merchantid is null;
and also to find items used on vendors but not in the DB
Code:
select npc_types.id, npc_types.name, merchant_id, merchantlist.slot, merchantlist.item from npc_types, merchantlist left join items on merchantlist.item = items.id where merchant_id <> 0 and merchant_id = merchantid and items.id is null;
and finally items used in loot but not in the DB
Code:
select npc_types.id, npc_types.name, npc_types.loottable_id, lootdrop_entries.item_id from npc_types, loottable_entries, lootdrop_entries left join items on lootdrop_entries.item_id = items.id where npc_types.loottable_id <> 0 and npc_types.loottable_id=loottable_entries.loottable_id and loottable_entries.lootdrop_id=lootdrop_entries.lootdrop_id and items.id is null;
Whew.
Hope that helps out. Note this will not find "broken" stuff if a a lootdrop or merchantlist entry

Oh one more for the tradeskill table items, sorry not sure of a way to make it all 1 query
Code:
select tradeskillrecipe.id, product from tradeskillrecipe left join items on product = items.id where product <> 0 and items.id is null;
select tradeskillrecipe.id, product2 from tradeskillrecipe left join items on product2 = items.id where product2 <> 0 and items.id is null;
select tradeskillrecipe.id, failproduct from tradeskillrecipe left join items on failproduct = items.id where failproduct <> 0 and items.id is null;
select tradeskillrecipe.id, i1  from tradeskillrecipe left join items on i1  = items.id where i1  <> 0 and items.id is null;
select tradeskillrecipe.id, i2  from tradeskillrecipe left join items on i2  = items.id where i2  <> 0 and items.id is null;
select tradeskillrecipe.id, i3  from tradeskillrecipe left join items on i3  = items.id where i3  <> 0 and items.id is null;
select tradeskillrecipe.id, i4  from tradeskillrecipe left join items on i4  = items.id where i4  <> 0 and items.id is null;
select tradeskillrecipe.id, i5  from tradeskillrecipe left join items on i5  = items.id where i5  <> 0 and items.id is null;
select tradeskillrecipe.id, i6  from tradeskillrecipe left join items on i6  = items.id where i6  <> 0 and items.id is null;
select tradeskillrecipe.id, i7  from tradeskillrecipe left join items on i7  = items.id where i7  <> 0 and items.id is null;
select tradeskillrecipe.id, i8  from tradeskillrecipe left join items on i8  = items.id where i8  <> 0 and items.id is null;
select tradeskillrecipe.id, i9  from tradeskillrecipe left join items on i9  = items.id where i9  <> 0 and items.id is null;
select tradeskillrecipe.id, i10 from tradeskillrecipe left join items on i10 = items.id where i10 <> 0 and items.id is null;
These could be modified to use unique to get just the items that are missing, but you should get the idea.
__________________
Please read the forum rules and look at reacent messages before posting.
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 04:39 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3