select 重复列数量

2016-10-08  本文已影响0人  SarahCatte

select distinct count(*) AS count, VL_GUESTNAME from  T_VISIT_LOG where CONVERT(varchar(10),VL_CHECKINTIME,120)>'2015-09-30' GROUP BY VL_GUESTNAME Order by count DESC

筛选出最近一年访客及访问次数

select  distinct top 6 count(*) AS count, GUESTNAME from  EV_VISIT_LOG where CONVERT(varchar(10),CHECKINTIME,120)>'2015-09-30' GROUP BY GUESTNAME Order by count DESC

列出访问次数最多的前六名访客

上一篇 下一篇

猜你喜欢

热点阅读