Re: How to retrieve latest record when date and time are separate ?
Date: 9 Jul 2003 23:34:07 -0700
Message-ID: <7e29a94a.0307092234.4dc745c9_at_posting.google.com>
Thanks to all, who answered. Sorry for the simple formulation. I also found one solution (similar to Daniel Roy's).
SELECT PERSON_ID,
MAX(DATE_COLUMN + (TIME_COLUMN - TO_DATE('1970-01-01',
'yyyy-mm-dd')) )
FROM ATTENDANCE
GROUP BY PERSON_ID
But I doubt about whether indexes on date and time columns (both in my
or D.Roy's solution) are used. Am I able to find out whether they are
used ?
I use standard utilities ( Sql Plus Worksheet, DBA studio, Toad).
J.N.
jirinej_at_volny.cz (JN) wrote in message news:<7e29a94a.0307090205.179bca49_at_posting.google.com>...
> I record attendance of persons to table with these columns:
> PERSON_ID, DATE, TIME, CODE .
> Is it possible to write SQL query, which gives me latest record of all
> persons? Unfortunately, the DATE and TIME are separate columns.
> Thanks for any ideas.
Received on Thu Jul 10 2003 - 08:34:07 CEST