我打开一个事务并在表中插入一行并关闭ssms并重新打开并检查表但结果集中未提交的事务为什么会发生这种情况请告诉我
答案 0 :(得分:0)
因为某些其他月的数据有28位。我建议:
select cast([datetime] as date), count(*)
from (select distinct cm.*
from logs_currentmonth cm
) cm
where [datetime] >= '2016-10-01'
group by cast([datetime] as date)
order by cast([datetime] as date);
如果您不需要select distinct
,请不要使用它!它只会减慢查询速度。