gpt4 book ai didi

sql - 如何转换 hh :mm:ss to hh:mm in SQL Server?

转载 作者:行者123 更新时间:2023-12-02 07:35:00 32 4
gpt4 key购买 nike

如何在 SQL Server 中将 hh:mm:ss 转换为 hh:mm?

select Count(Page) as VisitingCount,Page,CONVERT(VARCHAR(8),Date, 108) from scr_SecuristLog   
where Date between '2009-05-04 00:00:00' and '2009-05-06 14:58'
and [user] in(select USERNAME
from scr_CustomerAuthorities )
group by Page,Date order by [VisitingCount] asc

最佳答案

CONVERT(VARCHAR(5),Date, 108)-- 仅获取 HH:mm

关于sql - 如何转换 hh :mm:ss to hh:mm in SQL Server?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/820155/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com