Showing the last database entry in an label

Fox

Active Member
Licensed User
Longtime User
hello guys how can i show the last database entry in an label? is this possible if yes how?
 

eps

Expert
Licensed User
Longtime User
Define last...

Do you mean the last record created in a table? Usually this is done via a key identifier, ie the highest number or create date...
 
Upvote 0

Fox

Active Member
Licensed User
Longtime User
Define last...

Do you mean the last record created in a table? Usually this is done via a key identifier, ie the highest number or create date...

no i mean the last record that was created if i have an database an the last record of 1 colum that was created that i mean...
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
Be careful
SELECT last_insert_rowid()

works only when the database is initialized.
If you start the program and read a database and run SELECT last_insert_rowid() then you get 0.
Then after having added an entry and you call SELECT last_insert_rowid() then you get the right value.
If you have a column with the type of INTEGER PRIMARY KEY you can get the max value of this column with SELECT max(RowID) FROM DBTableName

Best regards.
 
Last edited:
Upvote 0
Top