当前位置:网站首页>Solve the problem that the time format of manually querying Oracle database is incorrect (date type)
Solve the problem that the time format of manually querying Oracle database is incorrect (date type)
2022-07-23 11:24:00 【Sun Junchen】
When writing code , It is often first to use visual tools to query the database for testing , Then write code according to the query statement
When the database is used Oracle And there are DATE Type , Will use string conversion DATE Function of TO_DATE(ch, fmt)
If fmt( The format of the date ) Use yyyy-MM-dd HH:mm:ss
for example :TO_DATE('2020-05-20 13:14:20' , 'yyyy-MM-dd HH:mm:ss')
In this way, mistakes will occur : ORA-01810: The format code appears twice
resolvent :
take mm Change it to mi, The detailed method is as follows
Using functions TO_DATE(ch, fmt)
ch: Input time ( character string )
fmt: The format of the date
12 hourly :yyyy-MM-dd HH:mi:ss
24 hourly :yyyy-MM-dd HH24:mi:ss
for example :TO_DATE('2020-05-20 13:14:20' , 'yyyy-MM-dd HH24:mi:ss')
边栏推荐
- Points for attention when using El table to lazy load tree tables
- 构造函数,原型链,instanceOf
- Application of higher-order functions: handwritten promise source code (4)
- Redis database and project framework
- JWT header for coding process
- [Hudi]hudi的编译及hudi&spark和hudi&flink的简单使用
- 高阶函数的应用:手写Promise源码(一)
- js的call、apply、bind
- 自定义MVC(上)
- JS class array objects and methods of class array conversion (ES6, Es5)
猜你喜欢
D2DEngine食用教程(1)———最简单的程序

Error handling of "listener not started or database service not registered" in Oracle database creation

Niuke question brushing record -- MySQL

通用查询&分页代码

使用el-table懒加载树形表格时的注意点

Machine learning algorithm for large factory interview (6) time series analysis

【uiautomation】键指令大全(以及三种调用方式)+常用鼠标动作+SendKeys+Inspect学习
![[flink]flink on yarn之flink-conf最简单配置](/img/de/0ec23f3379148dba27fe77dc51e22f.png)
[flink]flink on yarn之flink-conf最简单配置

简单实现矩形面积块

Getting started with RPC and thrift
随机推荐
【C语言】什么是函数?函数的分类和侧重(帮你快速分类和记忆函数)
Pytorch white from zero uses North pointing
同步发送短信验证码
When v-show is used with display:flex in the uni app applet, v-show does not take effect!
last-child不生效问题
Web Component-自定义元素的生命周期
Request data acquisition and response
MySQL之账号管理&&四大引擎&&建库建表
BurpSuite学习笔记
js的事件执行机制(Event loop)
[metric]使用Prometheus监控flink1.13org.apache.flink.metrics
General view, serializer
Machine learning algorithm for large factory interview (6) time series analysis
flex+js实现内部盒子高度跟随其中最大的高度
用getchar清理缓冲区(强烈推荐,C语言易错典型)
C语言调试常见错误——简答
TypeScript 高级类型
RPC与thrift入门
[监控部署实操]基于granfana展示Prometheus的图表和loki+promtail的图表
D2dengine edible tutorial (2) -- drawing images