Re: [sqlite] CAST vs. ROUND in ORDER BY

2014-06-22 Thread Tim Streater
On 22 Jun 2014 at 10:08, Clemens Ladisch wrote: > Tim Streater wrote: >> I have a text column containing floating point strings like 23.6, 8.4, >> 0.3, etc. These always have just the one digit after the decimal point. >> >> ... ORDER BY ROUND (myfield, 1); >> >> but now I see I could just as w

Re: [sqlite] CAST vs. ROUND in ORDER BY

2014-06-22 Thread Clemens Ladisch
Tim Streater wrote: > I have a text column containing floating point strings like 23.6, 8.4, > 0.3, etc. These always have just the one digit after the decimal point. > > ... ORDER BY ROUND (myfield, 1); > > but now I see I could just as well do: > > ... ORDER BY CAST (myfield AS REAL); > > Is

[sqlite] CAST vs. ROUND in ORDER BY

2014-06-22 Thread Tim Streater
I have a text column containing floating point strings like 23.6, 8.4, 0.3, etc. These always have just the one digit after the decimal point. This column was sometimes being used in an ORDER BY and then I realised that it wasn't going to sort properly. The use of a TEXT field was deliberate in