【发布时间】:2011-02-02 16:05:56
【问题描述】:
我目前正在使用以下查询在 2010 年 6 月完成所有检查:
select inspections.name
from inspections
where
to_char(inspections.insp_date, 'YYYY') = 2010 and
to_char(inspections.insp_date, 'MM') = 06;
但这感觉有点尴尬。难道没有更好的方法来做到这一点吗?看着http://infolab.stanford.edu/~ullman/fcdb/oracle/or-time.html 似乎并非如此。我正在使用 Oracle,如果它有所作为的话。
谢谢
【问题讨论】:
标签: sql database oracle constraints