I have been querying for the most recent (auto incrementing) ID of a given table I've inserted into (SELECT "id" FROM "my_table" ORDER BY "id" DESC LIMIT 1
), but I'm wondering if there exists a more general way to do this, instead.
Asked
Active
Viewed 150 times
0

Luxart
- 17
- 2
-
Which client are you using? JDBC? – Hannes Mühleisen May 19 '16 at 08:36
1 Answers
0
Get Column
SELECT max ("id") FROM "my_table"
Get Row
Select * from "my table" where "id" in (SELECT max ("id") FROM "my_table")

Alper Şaldırak
- 1,034
- 8
- 10