这样写:
select weathertime,weather from weathers
where to_char(weathertime,'yyyy-mm-dd') = to_char(sysdate,'yyyy-mm-dd');
select weathertime,weather from weathers
where to_char(weathertime,'yyyy-mm-dd') = to_char(sysdate,'yyyy-mm-dd');
解决方案 »
- 最近在用oracle sql developer,插入中文乱码~!~!~!~!~!~!
- Oracle怎么建立数据库
- 求教ORACLE10G安装问题!
- 把ORACLE,SHUTDOWN 后,再重启动,出现ORA-01102: ??? EXCLUSIVE ????????
- Oracle数据库如何还原
- oracle9i中存储的图片能不能在SQL PLUS中用命令显示出来
- 很奇怪的乱码问题!! 都有分!!解决后给100!谢啦!
- Oracle中date数据类型的问题(程序里输入的和数据库里显示的不同)
- 千万火急求救,高分赠送,怎样备份oracle数据库所有对象(包括表,存储过程,函数,触发器…)
- oracle 安装出错 runInstaller报错
- 创建数据库的问题!
- 数据导入导出问题
2 from weathers
3 where weathertime = to_char(sysdate,'dd-mon-yyyy');
而你資料庫内看者是只有日期,他的的時間其實就是00:00:00
所以你直接那sysdate和一個日期比較的時候要對sysdate取整,而不用進行轉換。試試這個語句.
select weathertime,weather
2 from weathers
3 where weathertime = trunc(sysdate)
你的weathertime是不是日期型?如果不是日期型會報錯。