标签: mysql sql postgresql sql-server-2008
如何计算下面提到的场景的日用资源数量:
我们如何在SQL中实现这一点??
答案 0 :(得分:0)
您需要COUNT(DISTINCT <...>)列
COUNT(DISTINCT <...>)
Emp.No
SQL Server
select [Date] ,[Resource Count] = count(distinct [Emp.No]) from YourTable group by [Date]