问题
I want to get MAX value of one column in sqlite table. The problem is the type of data is long in fact but stored as text in the table.How can I do with this strange situation. I've tried of this below but it's not correct
SELECT MAX(ColumnName) FROM TABLE;
But it returned value but not correct!Please someone can help me
回答1:
you could always cast the text to an int:
SELECT MAX(CAST(ColunmName) as int) from TABLE
来源:https://stackoverflow.com/questions/41634060/how-to-get-max-value-of-column-type-integer-stored-as-type-text-in-sqlite-table