order by data 
Author Message
 order by data
I have dates as '1998-06-24 17:30:39.000'. How can I order dates by year?

jk



Mon, 07 Jun 2004 20:39:13 GMT
 order by data

Quote:

>I have dates as '1998-06-24 17:30:39.000'. How can I order dates by year?

ORDER BY timestampcolumnname?


Mon, 07 Jun 2004 20:48:42 GMT
 order by data

order by extend(datetime_column year to year);

Might not work as such (in the order clause) in which case include it in
your select statement:

select extend(datetime_column year to year) YEAR, other_stuff
from wherever
order by YEAR
or
order by 1        /* first column in select list - change to suit */

As for your nomenclature; Oracle stores time in their dates - that is when
the developers don't opt for character.  Informix stores extensions like
that in a datetime.  That might help you when RTFM'ing.

cheers
j.

Quote:
----- Original Message -----


Sent: Thursday, December 20, 2001 7:39 AM
Subject: order by data

> I have dates as '1998-06-24 17:30:39.000'. How can I order dates by year?

> jk



Mon, 07 Jun 2004 23:14:14 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. data in sorted order in table without order by clause

2. Clustered index, physical data order, order by clause

3. select all data in order without order by clause

4. Export data as correctly ordered insert statements, Anybody?

5. rank order searching of coloumn data in SQL 7.0

6. How to change the default setting in order to insert data from a flat file

7. Multiphase Data Pump order

8. Ordering Data by Variable

9. physical data storage order

10. Export data as correctly ordered insert statements, Anybody?

11. changing primary keys in order to transfer data

12. copying table data w/ dif column order????


 
Powered by phpBB® Forum Software