i have two tables:
WHERE callcosts_custom.parent = callcosts.sequence
call_costs.sequence = callcosts_custom.parent
Yes . . . this sounds like a prioritization query. This typically looks like
select ccc.price from callcosts_custom ccc where ccc.?? = ?? union all select cc.price from callcosts ccc where cc.?? = ?? and not exists (select 1 from callcosts_custom ccc where ccc.?? = cc.??);
It is unclear from your question what the columns are.