这是sqlserver语句
select Count(ID) from DotTopic where 1>0 and datediff(d,AddTime,'2010/2/28 13:14:07')=0 and isDeleting=0
换成oracle语句应该怎么写。
问题是出在oralce没有datediff函数。
select Count(ID) from DotTopic where 1>0 and datediff(d,AddTime,'2010/2/28 13:14:07')=0 and isDeleting=0
换成oracle语句应该怎么写。
问题是出在oralce没有datediff函数。
不行的话可以用这个
abs(trunc(AddTime,'dd')-trunc(to_date('2010/2/28 13:14:07'),'yyyy-MM-dd hh24:mi:ss'),'dd')
---修改下
abs(trunc(AddTime,'dd')-trunc(to_date('2010/2/28 13:14:07','yyyy-MM-dd hh24:mi:ss'),'dd'))
http://07360591.javaeye.com/blog/135195