Well, there won't be a consistent result using sort because there might be 10 rows with same voucher code and same account code.
That's exactly the challenge so I don't know how sort will help.
If we can invert the entire resultset having the last record become first, then its worth while.
But again, I don't want the entire set of rows in the first place.
I just want that particular row.
Happy hacking.
Krishnakant.

On 20/07/11 19:20, Timuçin Kızılay wrote:
I think, reversing the sort and getting the first record will do.



20-07-2011 16:32, Krishnakant Mane yazmış:
Hello all,
Subject line says it all.
Basically what I want to do is to get last record from a result set.
I am dealing with a situation where given a date I need to know the last
record pertaining to transaction on a given account.
yes, it is an accounting/ book keeping software.
So I thought there was some thing like .last() method for a resultset?
Or even better do we have some thing like session.query(table).last()
The problem is that my logic is in place but I know that performance
wise it is very dirty to get the list of all records, just to loop till
the end and throw away all the rest of the rows.
So plese suggest how can I only get just that one (last) record?
Happy hacking.
Krishnakant.



--
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to