royalcheese
Technical User
Hi all , relitivly new to SQL and i have made this so far ....
this returns
project dep count of dep
ECP12674 621 21
ECP12674 641 5
What i want to do is to return only the row with the highest count of dep e.g ,
ECP12674 621 21
this is a small section of data with many projects and many dep's , can i get any pointers please ?!
. Many thanks
C
Code:
select a.project
, a.department
, count(a.department)
from atsproject as a
join acrclient as b on b.municipal = 'Y' and b.client = a.client
where a.project = 'ECP12674'
group by a.project
, a.department
order by a.project asc
, count(a.department) desc
this returns
project dep count of dep
ECP12674 621 21
ECP12674 641 5
What i want to do is to return only the row with the highest count of dep e.g ,
ECP12674 621 21
this is a small section of data with many projects and many dep's , can i get any pointers please ?!
. Many thanks
C