Skip to content
Advertisement

sum(datediff()) in oracle sql

so i need this to write in oracles sql using sysdate

sum(datediff(day,Clan.Dat_od,(CASE when clan.dat_do is null then getdate() else clan.dat_do end ))) as brojdana 

Advertisement

Answer

In Oracle, this would look like:

select sum(coalesce(clan.dat_do, trunc(sysdate)) - trunc(clan.dat_od)) as brojdana 
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement