View Single Post
  #1  
Old 11-06-2015, 10:48 PM
Uleat's Avatar
Uleat
Developer
 
Join Date: Apr 2012
Location: North Carolina
Posts: 2,815
Default Show All Player Useable Spells By Level Query

This arose from an exercise in futility - if you find it useful...

Code:
SET @sl = '1'; -- spell level
SET @qstr = CONCAT('SELECT \'', @sl, '\' level, `id`, `name`, `targettype` target_type, `SpellAffectIndex` spell_effect_index FROM `spells_new` WHERE \'', @sl, '\' IN (', (SELECT GROUP_CONCAT(CONCAT('`',`COLUMN_NAME`,'`') ORDER BY `ORDINAL_POSITION` SEPARATOR ',') FROM `information_schema`.`COLUMNS` WHERE (`table_schema` = DATABASE() AND `TABLE_NAME` = 'spells_new' AND `COLUMN_NAME` LIKE 'classes%')), ') ORDER BY `name`');
PREPARE stmt FROM @qstr;
EXECUTE stmt;
__________________
Uleat of Bertoxxulous

Compilin' Dirty
Reply With Quote