dkilby
asked on
oracle sql developer + get hour from datetime field
I need to compare an hour field
this works in MS SQL and trying to get similar in Oracle SQL Developer
hh is a number ie: 8
sum(case when hh=datepart(hour, dateadd(hh,1,getdate())) then 1 else 0 end) > 0
the current time - 1 hour and then just getting the hour.
this works in MS SQL and trying to get similar in Oracle SQL Developer
hh is a number ie: 8
sum(case when hh=datepart(hour, dateadd(hh,1,getdate())) then 1 else 0 end) > 0
the current time - 1 hour and then just getting the hour.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You may be able to do a pretty direct port from SQL Server to Oracle but I will caution you that it may not perform the same. The two databases do things pretty differently. To get Oracle to perform, you need to understand how and why it does what it does.