mercredi 23 septembre 2015

SQLite: How to get max from split string

In a SQLite3 database, I have a table "projects" which id field is composed the following way:

[user id]_[user's project id]

For example, with user id=45, here is some data:

45_1
45_10
45_102
45_2
45_3
45_4
45_68
45_9

I need to get the max of the project id, which is the number after the '_' delimiter (which is 102 in the example). How can I achieve that?

Thank you in advance.

Aucun commentaire:

Enregistrer un commentaire