同一个ID有可能存在多次登陆和登出用嵌套--> --> (Roy)生成测试数据 declare @T table([UserID] int,[OnP] nvarchar(3),[OnTime] Datetime)Insert @Tselect 1,N'on','2007-7-1 7:00' union allselect 1,N'off','2007-7-1 8:00' union allselect 2,N'on','2007-8-9 12:45' union allselect 3,N'on','2007-8-9 13:50' union allselect 2,N'off','2007-8-9 16:1...
|