I think this is answered, but since you are a bit new to SQLite, and to be somewhat more informant...

On 2016/09/14 3:19 PM, David Crayford wrote:
Of course. How do I do something similar to DB2 decimal() function which will add trailing zeros to precision? I tried round(col,6) but it knocked off the trailing zero like 12.12345.

It's not so much the trailing zeroes you need, it's the leading spaces. But you should order by the original value, not by "column 2" because "column 2" contains RESULTS (or OUTPUT if you will), not original values, and you have stringified the results with your printf() statement, so they will now sort like strings.

At least, this is how SQLite thinks of that statement - I'm unsure if this is in line (or not in line) with any standard. I think from a previous discussion we concluded that ordering, limiting and offsetting were all non-standard adaptions by various SQL implementations and so have no true conformance spec.


_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to