I have a model teststep
which has the attributes sequence
and revision
. The attribute revision
contains an increased number for every record with the same sequence
, like this:
id: 1, sequence: 1, revision: 1
id: 2, sequence: 2, revision: 1
id: 3, sequence: 2, revision: 2
id: 4, sequence: 2, revision: 3
How can I get the records with all different sequence
's, but only the highest revision
, in this case records with id
1 and 4? I tried something with distinct, but that doesn't work.