SQL Server, SSRS and Crystal Reports
Thursday, 24 May 2018
Count Distinct Over Partition
To get a count of distinct values over a windowing partition:
DENSE_RANK() OVER (PARTITION BY e.Dept_Desc order by e.Staff_No)
+ DENSE_RANK() OVER (PARTITION BY e.Dept_Desc order by e.Staff_No desc)
- 1
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment