日期:2014-05-17 浏览次数:20548 次
select top 10 * from tb where DATEPART(weekday,LoginTime) in(6,7) order by LoginTime desc
select
distinct b.*
from
tb a
cross apply
(select top 10 * from tb where LoginTime=a.LoginTime and DATEPART(weekday,LoginTime) in(6,7) order by LoginTime desc)b
select DATENAME(WEEKDAY,@Date) AS '本日是周几'
select DATEPART(WEEKDAY,@Date) AS '本日是周几'--返回值 1-星期日,2-星期一,3-星期二......7-星期六
select top 10 loginIP,loginTime from 表
where datepart(weekday,loginTime)=6 or datepart(weekday,loginTime)=7