Is this the correct way that a query is processed?
from
where
group by
having
select
order by
into
If this is correct, what is the explanation of a query like
select col1,count(*)
from #table
where date>=getdate()
group by col1
having count(*)>2
if the having is processed before the select - how does it know how the count(*) is being aggregated?