Your query will ful scan the uln_syn table and test the EXISTS condition for each row. Try this instead:Code:SELECT uln_syn.poe_ald_cal AS grp0, SUM ( uln_syn.sumoftotal_stons ) tot0 FROM uln_syn WHERE tpfdd_runid_uln = ( SELECT ca_keys.comp_key FROM ca_keys WHERE ca_keys.comp_id = '0x080e00000107235e9e7f0a1428098124') GROUP BY uln_syn.poe_ald_cal;




Reply With Quote