Hi,

1. I need to sort a date column by desc order. If I have added in an index on that column in desc order, then my sql statement do not need to include the order by clause and it will be sorted already, am I right about this?

2. I have created the following sql to show the first 20 students who have studied math between the date period and sort then according to desc order. However this sql doesn't work if the month is different, only within the same month, it can be sorted out neatly. Is there any problems with my sql or is it an oracle problem? I am using Oracle 8.1.5.

select a.*
(select st.student_id, to_char(st.register_date, 'dd-mm-yyyy hh24:mi') reg_date, rownum news_row
from student, sb.subject
where st.sudent_id = sb.student_id
and sb.subject_name like '%math%'
and st.register_date >= to_date('01-10-2000, 'dd-mm-yyyy')
and st.register_date <= to_date('01-11-2000, 'dd-mm-yyyy') + 1
/* error? without + 1 it will not be inclusive */
order by reg_date desc ) a,
student st
where st.student_id = a.student_id
and rownum >= 1
and rownum <= 20
/


Please help and suggest anything u have, all are welcome and appreciated.
Thanks! :)