[英]how to get data from rows where date(format monyy) is greater than today
I have a database with a column listing the dates as MONYY ex. 我有一个数据库,其中有一个列,列出的日期为MONYY ex。 FEB05,JUN12, etc. I want to get data from rows with date>= today. FEB05,JUN12等。我想从日期> =今天的行中获取数据。 I tried using to_date as below 我尝试如下使用to_date
select t.date, t.data, to_date(t.date, 'monyy') from table t
where to_date(t.date,'monyy') >='8/1/2012'
But I get error saying that FROM keyword is not at expected location. 但是我收到错误消息,说FROM关键字不在预期的位置。
Need help in writing this query. 在编写此查询时需要帮助。
table
is a reserved word and not a valid table name. table
是保留字,不是有效的表名。 Exchange table
for the actual name of your table. 将table
为table
的实际名称。
Edit: I tried it, and it worked if I changed the final date to: 编辑:我尝试过,并且如果我将最终日期更改为:
to_date('8/1/2012', 'mm/dd/yyyy')
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.