Home > database >  The number of days from 0 to the current date in oracle, how to write?
The number of days from 0 to the current date in oracle, how to write?

Time:09-17

The number of days from 0 to the current date in oracle, how to write?

CodePudding user response:

- try this, not sure if this date is legal,
The select sysdate - the date '0000-01-01' from dual

CodePudding user response:

reference 1st floor selling fruit net reply:
- try this, not sure if this date is legal,
The select sysdate - the date '0000-01-01' from dual

That I've tried several complains numerical to negative four thousand to nine thousand nine hundred and ninety-nine and cannot be zero

CodePudding user response:

refer to the second floor nightmare, response:
Quote: refer to 1st floor selling fruit net reply:
- try this, not sure if this date is legal,
The select sysdate - the date '0000-01-01' from dual

That I've tried several complains numerical to negative four thousand to nine thousand nine hundred and ninety-nine and cannot be zero


 
- how do you try and post the result of your test

SQL> The select sysdate - the date '0000-01-01' x1,
2 trunc (sysdate - the date '0000-01-01) x2
3 the from dual;
The X1 X2
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
737567.344 737567

SQL>

CodePudding user response:

reference 3 floor selling fruit net reply:
Quote: refer to the second floor nightmare, response:

Quote: refer to 1st floor selling fruit net reply:
- try this, not sure if this date is legal,
The select sysdate - the date '0000-01-01' from dual

That I've tried several complains numerical to negative four thousand to nine thousand nine hundred and ninety-nine and cannot be zero


 
- how do you try and post the result of your test

SQL> The select sysdate - the date '0000-01-01' x1,
2 trunc (sysdate - the date '0000-01-01) x2
3 the from dual;
The X1 X2
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
737567.344 737567

SQL>


CodePudding user response:

 
- it's convenient, would a print the results,
Show parameter NLS;

- look at website, to have any related information,

- if try so hard, in 0001-01-01,

CodePudding user response:

reference 5 floor selling fruit net reply:
 
- it's convenient, would a print the results,
Show parameter NLS;

- look at website, to have any related information,

- if try so hard, in 0001-01-01,

big real active!

CodePudding user response:

I think calculated from '0001-01-01,
Select TRUNC (sysdate - TO_DATE (' 0001-01-01 ', '- DD YYYY - MM)) from dual;
  • Related