Soundsmith
Programmer
I have a table which holds transaction records-many records per claim, many claims. primary key is combination of cnum plus seq, both Longs.
I would like to create an SQL query to display all the fields in the table, but only the most recent transaction (highest seq for each cnum).
It seems to me this should be fairly simple, but I don't see any references in the archives, and nothing I can do works. Group By has many non-aggregate fields, and top 1 just produces a single record. I can do this with a dual query, that pick cnum and MAX(seq) group by cnum and use this to select * where both criteria are met, but I would like to use a single query if possible.
Any ideas would be appreciated. Thanks
David 'Dasher' Kempton
The Soundsmith
I would like to create an SQL query to display all the fields in the table, but only the most recent transaction (highest seq for each cnum).
It seems to me this should be fairly simple, but I don't see any references in the archives, and nothing I can do works. Group By has many non-aggregate fields, and top 1 just produces a single record. I can do this with a dual query, that pick cnum and MAX(seq) group by cnum and use this to select * where both criteria are met, but I would like to use a single query if possible.
Any ideas would be appreciated. Thanks
David 'Dasher' Kempton
The Soundsmith