Подскажите плиз, почему птица не хочет групировать так? вроди ничего криминального...
select iif(s.bundle_id is not null, 10, coalesce((select 3 from ta_bundle b where b.submit_slot_id = s.id and b.status_id = 3 rows 1), 1)) as status_id from ta_submit_slot s where s.submit_id = :submit_id group by 1