查询当月每天求职者注册的数量

/*create:zhouhai*/
/*2008-10-28)*/
/*查询当月每天注册的简历数*/
WITH persons_temp AS
(
    
SELECT personID,[name],createDate,DAY(createDate) [day] FROM b_persons
    
WHERE DATEDIFF(m,GETDATE(),createDate)=0
)
,persons_temp_rowCount 
AS
(
    
SELECT personID,[name],createDate,[day],
    RANK
=ROW_NUMBER() OVER (PARTITION BY [day] ORDER BY createDate DESC)
    
FROM persons_temp
)
SELECT [day],MAX(RANK) rowCountPerDay FROM persons_temp_rowCount GROUP BY [day] ORDER BY [day] ASC

posted on 2008-10-28 14:23  周海  阅读(233)  评论(0)    收藏  举报

导航