Quote:
|
Originally Posted by joe robles
I have a requirement to retireve the unique Dept_nos whose Emp_counts are unique.
|
"stupidest requirement of the day" award, but here you go anyway...
Code:
SELECT MIN(Dept_no) AS Dept_no
, Emp_count
FROM daTable
GROUP
BY Emp_count
HAVING COUNT(*) = 1
by the way, in your sample data, only departments 1, 2, and 6 should be returned
dept 3 should ~not~ be returned, because 30 is ~not~ unique in the Emp_count column