发布网友 发布时间:2024-10-23 01:50
共2个回答
热心网友 时间:2024-11-09 03:03
数据大,建议先建立索引(最好包含查询到的字段),优化查询:
create index index_table_1 on Table(memberId) include(vistTime)
select memberId,convert(varchar(10),vistTime,120) as vt,count(*) as cts
from Table group by memberId,convert(varchar(10),vistTime,120)
热心网友 时间:2024-11-09 03:11
select memberId,convert(varchar(10),操作时间,120) as '日期',count(*) as '次数'
from
操作记录表
group by memberId,convert(varchar(10),操作时间,120)