sql中常用sql语句

按天来分组查询 

select convert(varchar(10),addtime,120)  from user_online_statis  group by convert(varchar(10),addtime,120);

 

sql语句分页

select * from(
select row_number() over(order by addtime desc) rowid,count(1) over() as 'count',* from Taiwan_ActiveLog with(nolock) where activeid=10
)d where rowid>(2-1)*10 and rowid<=2*10

 

posted @ 2018-07-23 11:24  ITMrRight  阅读(170)  评论(0编辑  收藏  举报