[sqlite] Function to use to convert a text float to a float for use in ORDER BY

2018-05-17 Thread Tim Streater
My db has a table with a column defined thus: body_size text default '0.0' whose purpose is to hold the size of the item that the row represents. All rows contain a value but as a string to one decimal place, not a number. So the column contains strings such as '0.0', '3.7', '22.9', etc. All

Re: [sqlite] Function to use to convert a text float to a float for use in ORDER BY

2018-05-17 Thread Keith Medcalf
pated traffic volume. >-Original Message- >From: sqlite-users [mailto:sqlite-users- >boun...@mailinglists.sqlite.org] On Behalf Of Tim Streater >Sent: Thursday, 17 May, 2018 15:42 >To: SQLite mailing list >Subject: [sqlite] Function to use to convert a text float to a flo

Re: [sqlite] Function to use to convert a text float to a float for use in ORDER BY

2018-05-17 Thread Abroży Nieprzełoży
; lot about anticipated traffic volume. > > >>-Original Message- >>From: sqlite-users [mailto:sqlite-users- >>boun...@mailinglists.sqlite.org] On Behalf Of Tim Streater >>Sent: Thursday, 17 May, 2018 15:42 >>To: SQLite mailing list >>Subject: [sqlite] Function

Re: [sqlite] Function to use to convert a text float to a float for use in ORDER BY

2018-05-18 Thread Tim Streater
On 17 May 2018, at 23:13, Keith Medcalf wrote: > select col1, col2 from mytable order by cast(body_size as float); Thank you. That's much better (although abs(body_size) worked too). -- Cheers -- Tim ___ sqlite-users mailing list sqlite-users@mai