lundi 1 février 2016

How to select the max int value of a TEXT column in SQLite

Given a TABLE mytable with a column of TEXT name containing VALUES 1, 2, 2b, 2c, 3. How do you select the maximum INT value in SQLite?

-- Does not work in SQLite
SELECT MAX(VAL(textcol)) FROM mytable;

Took me some time to find as I kept falling on instructions for other SQL syntaxes.

Aucun commentaire:

Enregistrer un commentaire