Oracle 日期比较
假设我有以下代码
Some Sql query... 后面跟着这个条件
AND EndDate < TO_DATE('02/14/2011','MM/DD/YY')+1
是否与以下相同
AND EndDate <= TO_DATE('02/14/2011','MM/DD/YY')
Say I have the following code
Some Sql query... is followed by this condition
AND EndDate < TO_DATE('02/14/2011','MM/DD/YY')+1
Is it that same as
AND EndDate <= TO_DATE('02/14/2011','MM/DD/YY')
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
注意:我假设根据您的 to_date 格式,EndDate 是日期字段而不是日期/时间数据类型。
两个查询应返回相同的结果集。考虑以下情况:
两个结果都将产生“TRUE”。你有什么疑问?
Note: I am assuming based on your to_date formatting that the EndDate is a date field and not a date/time data type.
Both queries should return the same result set. Consider the following:
Both results would yield "TRUE". What doubts are you having?
取决于 EndDate 是 DateTime 还是只是 Date。如果 EndDate = 2/14/2011 3:00:00,则第二个将为 false,但第一个为 true。
Depends if EndDate is a DateTime or just a Date. If EndDate = 2/14/2011 3:00:00, the second one would be false but the first true.