select distinct trandate,
(Select MAX(empname) from emp e where e.empid=s.empid),
sum(tranamt)
from [sales trans] s
group by trandate,s.empid
having SUM(tranamt)>50000
---it will give you per day per emp per sum(tranAmt on that day) if greater than 50K. you can remove trandate from select if you need just name and amount as we group by trandate here..
Trending Articles
More Pages to Explore .....