This one is 'pie-in-the-sky' so if you ignore it, I understand.
But, I am not aware of an SQL tool that does this...
It would be nice if in the following query:
select count(a.account_number) totalaccounts,
sum(case when emails = null then 1 else 0 end) noemail,
sum(case when emails >=1 then 1 else 0 end) anemail,
sum(case when emails =2 then 1 else 0 end) twoemail,
sum(case when emails >2 then 1 else 0 end) threeormoreemail
from notedb..note_master a
join notedb..note_status b on b.note_status_id = a.note_status_id
join relm..pool c on c.pool = a.pool
Join alloc_balance_table d on a.account_number = d.account_number
left join ( select z.account_number, count(y.purchaser_email_id) emails
from notedb..purchaser_note z
join purchaser_email y on z.purchaser_id = y.purchaser_id
where y.active=1
group by z.account_number
) e on e.account_number = a.account_number
where c.servicing_type_id not in (2,3,4,5)
and b.note_status_master_id in (3,4)
and d.allocation_type_id = 199
and d.balance > 100
It would be nice if the auto-complete would understand the derived table (alias e).
This isn't a big deal, and to a casual reader it probably sounds like even less of a deal, but it is a bit of a distraction when you are used to the auto-suggest popping up each time and then it doesn't, it kind of hampers the rhythm.
Like I said, this is very pie-in-the-sky, but I thought I would bring it up.