急!!informix中如何得到某datetime字段的月份?

RevivalSky 2003-08-19 09:40:19
我知道在oracle中可以这样写:
select * from table_name where to_char(mydate,'mm')='08'

类似这样的效果在informix中要如何写?

希望哪位大家帮忙!
...全文
183 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
Azz1 2003-08-20
  • 打赏
  • 举报
回复
select * from tab where month(d1) =8;

RevivalSky 2003-08-20
  • 打赏
  • 举报
回复
顶一支阿

如果我要做这样的转换呢?

select * from tab where
to_char(to_date(strdate,'yyyy-mm-dd hh24:mi:ss'),'mm')='08'


谁能告诉我?
wenlq 2003-08-20
  • 打赏
  • 举报
回复
select * from tab where extend(d1,month to month ) ='08';

select * from tab where substr(d1,6,2) ='08';

1,195

社区成员

发帖
与我相关
我的任务
社区描述
其他数据库开发 Informix
社区管理员
  • Informix社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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