---
title: "ORA-01810: format code appears twice"
author: "e_e"
date: "2016-08-05T15:07:14Z"
tags: []
categories: ["数据库"]
slug: "ora-01810-format-code-appears-twice"
draft: false
lastmod: "2016-08-05T15:08:13Z"
id: 2315778
url: "https://e-e.iteye.com/blog/2315778"
---

《Oracle就是矫情》

错误：

select * from SCORE\_ORDER t where app\_create\_time between to\_date('2016/08/04 00:00:00','yyyy/MM/dd HH:mm:ss') and to\_date('2016/08/04 23:00:00','yyyy/MM/dd HH:mm:ss')

 

查询时报错ORA-01810: format code appears twice

原因是月用MM，分钟用mm，在oracle中不允许

 

更正：

select * from SCORE\_ORDER t where app\_create\_time between to\_date('2016/08/04 00:00:00','yyyy/MM/dd HH:mi:ss') and to\_date('2016/08/04 23:00:00','yyyy/MM/dd HH:mi:ss')

 

 ==============================================================================