I am running into a slight problem in Oracle SQL.
I have a table that has the following columns
(ID, AttributeID, AttributeValue, Version).
I would like to query the table for the latest version given an attribute id.
For example, if I have the following data
ID AttrId AttrValue Version
1 1 A 1
1 1 B 2
1 1 C 3
2 1 F 1
2 2 G 1
If I decided to filter by attribute id 1, I would like to get
ID AttrId AttrValue Version
1 1 C 3
2 1 F 1
The query will be very simple if I supply the id, because I can filter first
by the ID and AttributeID, and then find the max for the version column.
However, I am still looking and thinking of a solution when the ID is not given, and
would like to just get a list based on the AttributeID only.
Any tips would help greatly!
thanks!
Would this help?