Home  >  Article  >  Database  >  Oracle何时使用to_date函数

Oracle何时使用to_date函数

WBOY
WBOYOriginal
2016-06-07 17:05:261217browse

首先看数据类型,A字段日期型,比较时直接使用gt;=;B字段字符型,比较时要使用to_date函数转化,格式自己指定;A LOGON_TIM

首先看数据类型,,A字段日期型,比较时直接使用>=;B字段字符型,比较时要使用to_date函数转化,格式自己指定;

A    LOGON_TIME   DATE

B    KPI_VALUE    VARCHAR2(400)

下面是具体比较语句

select count(*) from  C   where  A>='2011-07-01' and DATE_TIME

select count(*) from  D   where  B>=to_date('20110701','yyyymmdd')  and date_time

linux

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn