oql query to only return the last associated row of 2 entities.

0
Hi Guys. I have an oql query with a left join. My data return is one to many.  On the many side, I have a few attributes I can use like counter and DateTime. Does anyone know how I can construct the left join or using the where  part to only return the last associated row? appnumber,  SystemXCallcounter, SystemXCallDateTime ,  123     1      19oct201809:44 123     2      19oct201809:50 123     3      19oct201809:52   I want only this row returned.
asked
1 answers
0

Hello Frankie, 

I would use a sort descending on the Counter or datetime, together with a top constraint, this should retrieve the last X entries depending on the number in your top constraint.

You could use something like:

SELECT appnumber,  SystemXCallcounter, SystemXCallDateTime FROM MyModule.MyEntity
ORDER BY SystemXCallcounter DESC
Limit 2

Hope this helps

answered