How To Select the last inserted row
-
Hi, I would like to know how do i select the last inserted row in a table :sigh::confused: Thank you
La Light
Do you need to whole row or just the ID? You could try something like this for the whole row: SELECT * FROM tblSomething WHERE tblID = IDENT_CURRENT('tblSomething')
Pablo Sometimes I think there's no reason to get out of bed . . . then I feel wet, and I realize there is.
-
Hi, I would like to know how do i select the last inserted row in a table :sigh::confused: Thank you
La Light
If the table has an Identity field (ID) or a created date field then this is fairly easy
select top 1 * from table ORDER BY myfield DESC
Blog Have I http:\\www.frankkerrigan.com
-
If the table has an Identity field (ID) or a created date field then this is fairly easy
select top 1 * from table ORDER BY myfield DESC
Blog Have I http:\\www.frankkerrigan.com
-
Do you need to whole row or just the ID? You could try something like this for the whole row: SELECT * FROM tblSomething WHERE tblID = IDENT_CURRENT('tblSomething')
Pablo Sometimes I think there's no reason to get out of bed . . . then I feel wet, and I realize there is.