日期:2014-05-18  浏览次数:20446 次

一个很难的SQL问题,希望高手帮帮忙,小弟先谢谢各位啦!
下面这句是   :查询同一个用户在同一天的重复操作记录...

SELECT   I_User,   CONVERT(varchar(16),   I_date,   112)   AS   Ttime,   COUNT(*)   AS   SUM
FROM   table
GROUP   BY   CONVERT(varchar(16),   I_date,   112),   I_User
HAVING   COUNT(*)   >   1

我想把他改成   查询同一个用户在同一周的重复操作记录...

小弟先谢谢各位啦!


------解决方案--------------------
SELECT I_User, datepart(week,I_date) AS Ttime, COUNT(*) AS SUM
FROM table
GROUP BY datepart(week,I_date), I_User
HAVING COUNT(*) > 1

------解决方案--------------------
右上方,管理