I need help writing a SQL statement
I have an Equipment history table.
The primary key on the table is a composite key: ESN, StatusID, and date_insert.
I need to write a statement that will give me the last record for each ESN.
I am considering adding a column to the table to sequence the records, but I haven't done that yet.
Until then, can anyone help me write the where clause that will allow me to select the distinct records I need to report on?
If this isn't the correct forum, please let me know where I should post it.
Thanks in advance.
Karen
|