I need to retrieve the latest record in a table thus:
Table: entries
Columns:
entry_date Date
entry_number_for_date int --increments with each entry for a given entry date
a_n_other_field char(10)
there is an index defined as entry_date, entry_number_for_date
Can anyone confirm whether this is the most efficient way of retrieve the latest record from this table please? Ta:
set rowcount 1
select * from entries
order by entry_date desc, entry_number_for_date desc
set rowcount 0
Table: entries
Columns:
entry_date Date
entry_number_for_date int --increments with each entry for a given entry date
a_n_other_field char(10)
there is an index defined as entry_date, entry_number_for_date
Can anyone confirm whether this is the most efficient way of retrieve the latest record from this table please? Ta:
set rowcount 1
select * from entries
order by entry_date desc, entry_number_for_date desc
set rowcount 0

Comment