EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Database/World Building (https://www.eqemulator.org/forums/forumdisplay.php?f=596)
-   -   SQL Help: Linking NPC ID to zoneid (https://www.eqemulator.org/forums/showthread.php?t=31678)

Irreverent 07-16-2010 09:22 PM

SQL Help: Linking NPC ID to zoneid
 
ok, trying to create a SQL statement that will link a NPC to their zone #(because i really want the expansion column in the zone table)

Maybe i'm too excel but tried

Select a.name, b.expansion from npc_types a, zone b where b.zoneidnumber = left(a.id,length(a.id) - 3)) and length(a.id) > 3

csb4623 10-20-2010 01:14 AM

SELECT nt.name, s2.zone
FROM spawn2 s2
JOIN spawngroup sg
ON sg.id = s2.spawngroupid
JOIN spawnentry se
ON se.spawngroupid = sg.id
JOIN npc_types nt
ON nt.id = se.npcid
WHERE s2.zone = 'crushbone';


All times are GMT -4. The time now is 04:52 AM.

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