If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Oracle > ascending descending for date types

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old
Registered User
 
Join Date: Feb 2002
Location: iceland
Posts: 15
ascending descending for date types

what does it mean to sort date values from earliest to latest?
asc or desc ?
Reply With Quote
  #2 (permalink)  
Old
Moderator.
 
Join Date: Sep 2002
Location: UK
Posts: 5,171
Are you actually asking what it means? Or what the keywords are?

Anyway, an example should clarify:
Code:
SQL> select * from dept
  2  order by deptno asc;

    DEPTNO DNAME          LOC
---------- -------------- -------------
        10 ACCOUNTING     NEW YORK
        20 RESEARCH       DALLAS
        30 SALES          CHICAGO
        40 OPERATIONS     BOSTON

SQL> select * from dept
  2  order by deptno desc;

    DEPTNO DNAME          LOC
---------- -------------- -------------
        40 OPERATIONS     BOSTON
        30 SALES          CHICAGO
        20 RESEARCH       DALLAS
        10 ACCOUNTING     NEW YORK
If you don't specify asc or desc, then ascending order is the default.
__________________
Tony Andrews
http://tinyurl.com/tonyandrews
Reply With Quote
  #3 (permalink)  
Old
Registered User
 
Join Date: May 2004
Location: Elmira, NY USA
Posts: 5
Earliest to latest date is ascending. You've probably found that out, already, right?
Reply With Quote
  #4 (permalink)  
Old
Registered User
 
Join Date: Feb 2002
Location: iceland
Posts: 15
i already of course know what asc and desc does. my question is actually about the wording:

SYSDATE > SYSDATE-1 .ya.
i just wondered the earliest to latest, according to which date ?
according to say now, SYSDATE, earliest is SYSDATE-1 and latest is say 2 years ago.

But this may be also interpreted the reverse, not?
earliest being 2 years ago, and latest today, or today-1.
that was my point!


latest is "far away from today"
or "as near to today as possible"

Last edited by commageneus; 07-13-04 at 12:18.
Reply With Quote
  #5 (permalink)  
Old
Registered User
 
Join Date: Apr 2004
Posts: 246
earliest date is the earliest in relation to the birth of the cosmos.
Oldest date would be the one furthest back in time from today.
So, unless your users have invented a time-machine, and can travel backwards through the space-time continuum, I think everybody will agree that sysdate-200 is earlier than sysdate-2.
Reply With Quote
  #6 (permalink)  
Old
Moderator.
 
Join Date: Sep 2002
Location: UK
Posts: 5,171
...as in:

"Earlier today I had breakfast; later on I had lunch".
"Early in the last century there was no TV"
"The latest news is..."
__________________
Tony Andrews
http://tinyurl.com/tonyandrews
Reply With Quote
  #7 (permalink)  
Old
Registered User
 
Join Date: May 2013
Posts: 1
Quote:
Originally Posted by commageneus View Post
what does it mean to sort date values from earliest to latest?
asc or desc ?
Earliest to latest: Time is described numerically, where latest means "most recent."
So, if we go from YEAR 0 to YEAR 2013, we go from earliest to latest.
The year numbers increase, so earliest to latest is ASCENDING.
Reply With Quote
  #8 (permalink)  
Old
Lead Application Develope
 
Join Date: Jun 2004
Location: Liverpool, NY USA
Posts: 2,419
And of course 4000BC is earlier then 100AD
__________________
Bill
You do not need a parachute to skydive. You only need a parachute to skydive twice.
Reply With Quote
  #9 (permalink)  
Old
Registered User
 
Join Date: Aug 2003
Location: Where the Surf Meets the Turf @Del Mar, CA
Posts: 7,613
badgerbay,

I am sure that there are thousands upon thousands of threads on this forum that are more recent than this NINE YEAR old thread.

I applaud your desire to contribute, but suggest you focus on only recently opened threads.
__________________
You can lead some folks to knowledge, but you can not make them think.
The average person thinks he's above average!
For most folks, they don't know, what they don't know.
Don't say, show. Don't promise, prove.
Reply With Quote
  #10 (permalink)  
Old
Registered User
 
Join Date: Apr 2014
Posts: 1
Just to re-necro... Belated thanks to badgerbay, this was the info I wanted.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On