How to convert to_days function from Mysql to Oracle?

Viewed 384

I am using to_days() function in mysql as

to_days ( CURRENT_DATE  + interval '1' day )

Now I am deploying the same query on Oracle database, but oracleDB doesn't have a to_days() function.

What can I do?

1 Answers

In MySQL, to_days() comphutes the number of days between the given argument and year 0 (0000-00-00).

The equivalent for:

to_days(current_date)

Should be, in Oracle:

trunc(sysdate) - date '0001-01-01' + 364

As of today, both expressions return 737854.

Related