如图所示:
sql如下:
select ryid,ryxm,
kssj,
jssj
from dbo.testA
where kssj is not null
and left(kssj ,10) between '2023-02-08' and '2023-02-08'
group by ryid,ryxm,kssj,jssj
select 号码,姓名,
min(时间) as 最小时间,
max(时间) as 最晚时间
group by 号码,姓名
sqlserver?mysql?oracle?