Iter Ator
Iter Ator

Reputation: 9299

How to select the last inserted row in a table?

I have a table model. Adding, and editing rows works perfectly. But How is it possible, to select the last row, like when the user clicks on it?

public class MyModel extends AbstractTableModel {
    ...
}

Upvotes: 0

Views: 96

Answers (1)

Dima
Dima

Reputation: 8652

you can order by id desc and limit 1, or order by created_at desc limit 1 if you have this rows

Upvotes: 1

Related Questions