Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: trying to order date chronologically

Re: trying to order date chronologically

From: <Rajesh.Rao_at_jpmchase.com>
Date: Fri, 17 Jan 2003 13:49:36 -0800
Message-ID: <F001.005338EB.20030117134936@fatcity.com>

Sebastian,

I dont know if I understood this right, for this seems to be quite a simple task. Or maybe I am overlooking something very obvious.

Select to_char('date field','YYYYMMDD') from Mytable order by 1

Unless you dont want the date field displayed in that format in your report, but still want it sorted in the fashion described above, in which case :

column sortbydate noprint
Select to_char('date_field','YYYYMMDD') sortbydate, Date_field from Mytable
order by 1

Hope I got this right.

Raj

                                                                                                                         
                    "DiFelice,                                                                                           
                    Sebastian"                To:     Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com>        
                    <sebastian.difelic        cc:                                                                        
                    e_at_tfn.com>                Subject:     trying to order date chronologically                          
                    Sent by:                                                                                             
                    root_at_fatcity.com                                                                                     
                                                                                                                         
                                                                                                                         
                    January 17, 2003                                                                                     
                    04:14 PM                                                                                             
                    Please respond to                                                                                    
                    ORACLE-L                                                                                             
                                                                                                                         
                                                                                                                         




Is there a way to order the result set of a query by date chronologically? For example, I run a usage report for customers either monthly, quarterly, semi annual or annually. I need to return the result set chronologically by
month and I cannot seem to find a way to do it. Thanks for any help!

Sebastian DiFelice
Database Administrator
Thomson Corporation
Intelligence Data
(617) 856-1587

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: 
  INET: Rajesh.Rao_at_jpmchase.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L

(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).
Received on Fri Jan 17 2003 - 15:49:36 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US