Convert Text to Numbers in Sqlite
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...
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
1 Answer
See "CAST expressions" at .
SELECT CAST('3.02' as decimal)
-- they aren't real decimals in sqlite, though. beware floats.