Convert Text to Numbers in SQLite
SqliteSqlite Problem Overview
I have a sqlite DB with a table with the following structure LocationName Latitude Longitude all defined as varchar. How i can construct a sql statement to get all the locations with a specific lat range given latitude in decimal. is there a way to do that convert from varchar to decimal value on the fly ? or i have to step through the return statements and do the conversion manually
Sqlite Solutions
Solution 1 - Sqlite
See "CAST expressions" at http://www.sqlite.org/lang_expr.html.
SELECT CAST('3.02' as decimal)
-- they aren't real decimals in sqlite, though. beware floats.