left join

Development forum for the EQ2Emulator Database project.

Moderator: Team Members

Post Reply
User avatar
Ememjr
Team Member
Posts: 975
Joined: Wed Mar 15, 2017 9:41 am
EQ2Emu Server: Perseverance

left join

Post by Ememjr » Wed Mar 13, 2019 9:08 am

i am trying to get the sql statement correct for getting the spell_ts_ability_index loaded when spells load

Code: Select all

SELECT s.`id`, ts.spell_id, `name`, `description`, `type`, `class_skill`, `mastery_skill`,ts.index, `tier`, `hp_req`, `power_req`, `cast_time`, `recast`, `radius`, `max_aoe_targets`, `req_concentration`, `range`, `duration1`, `duration2`, `resistibility`, `hp_upkeep`, `power_upkeep`, `duration_until_cancel`, `target_type`, `recovery`, `power_req_percent`, `hp_req_percent`, `icon`, `icon_heroic_op`, `icon_backdrop`, `success_message`, `fade_message`, `cast_type`, `lua_script`, `call_frequency`, `interruptable`, `spell_visual`, `effect_message`, `min_range`, `can_effect_raid`, `affect_only_group_members`, `hit_bonus`, `display_spell_tier`, `friendly_spell`, `group_spell`, `spell_book_type`, spell_type+0, s.is_active, savagery_req, savagery_req_percent, savagery_upkeep, dissonance_req, dissonance_req_percent, dissonance_upkeep, linked_timer_id, det_type, incurable, control_effect_type, cast_while_moving, casting_flags, persist_through_death, not_maintained, savage_bar, savage_bar_slot, soe_spell_crc 
FROM spells s, spell_tiers st  
LEFT JOIN spell_ts_ability_index ts 
ON s.id = ts.spell_id
WHERE s.id = st.spell_id AND s.is_active = 1 
ORDER BY s.`id`, `tier`
but i get a Unknown column 's.id' in 'on clause'

what would be the proper way to join to get the ability index included on this

User avatar
Ememjr
Team Member
Posts: 975
Joined: Wed Mar 15, 2017 9:41 am
EQ2Emu Server: Perseverance

Re: left join

Post by Ememjr » Wed Mar 13, 2019 10:00 am

i think i got it working by enclosing spells s, spell_tiers st in () like this

Code: Select all

FROM (spells s, spell_tiers st)
that way that is excuted prior to the join and s.id will then be available

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests