Hi all,
I worte this query:
select c. CustomerID,COUNT(*) as total_orders
from Customers as c inner join orders as o
on c.CustomerID=o.CustomerID
group by c. CustomerID
having COUNT(*)> (select COUNT(*) as total_orders
from Customers as c inner join orders as o
on c.CustomerID=o.CustomerID
where c.CustomerID = 'alfki')
can i use subquery after having count ? or is it poor practice?
or is it always have to be
having count(*) >actual_number
thanks in advanced
Naama