筛选时间的问题

owenfan521 2003-12-24 11:27:15
有表a


时间 值
2003-12-10 438
2003-12-10 01:00:00 432
2003-12-10 02:00:00 4309
2003-12-10 03:00:00 989
2003-12-10 04:00:00 39
2003-12-10 05:00:00 87
.... ....
2003-12-11 53
2003-12-11 01:00:00 44
2003-12-11 02:00:00 4309
... ......

我需要提出以下的信息:(只需要整点时的信息)
时间 值
2003-12-10 438
2003-12-11 53
。。 。。。

我写了如下 的查询语句:
select * from a
where 时间 not like '%00:00'
但是却不是我要的结果?为什么?


...全文
92 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
victorycyz 2003-12-24
  • 打赏
  • 举报
回复
select * from a where convert(varchar(8),时间,108)='00:00:00'
dlpseeyou 2003-12-24
  • 打赏
  • 举报
回复
select 时间=convert(varchar(10),时间,120),值 from a
hmzgz81 2003-12-24
  • 打赏
  • 举报
回复
select * from a
where convert(varchar(8),时间,108) not like '%00:00'
sdhdy 2003-12-24
  • 打赏
  • 举报
回复
select * from a
where convert(varchar(8),时间,108) not like '%00:00'
dafu71 2003-12-24
  • 打赏
  • 举报
回复
select * from a where convert(varchar(20),时间,108) not like '%00:00'

34,588

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧