I have a table containing information about records. There can be several drafts of each record. To query the info for the highest draft I currently do:
select
record_id,
record_name,
record_date
from
RECSTABLE
where
record_number = XXXXX
AND record_draft = (select max(record_draft)
from RECSTABLE
where record_number = XXXXX)
This returns the correct results, but it's cumbersome. I want to do something more advanced.
I have a list or record_numbers I want to run this query for. The question is how can I do this recursively, how can I optimise this query?
Thanks