Hello!

В сообщении от Sunday 08 February 2009 20:07:14 Dennis Cote написал(а):
> Alternatively, if you want to use SQL that is more portable, you could
> also cast the result of the SUM function to a floating point value to
> ensure that a floating point division is done.
>
>     sqlite> select cast(SUM(1) as real)/3;
>     0.333333333333333

There is simple and portable way:
sqlite> select 1.0*SUM(1)/3;
0.333333333333333

It's similar to tcl or another script language expression:
tclsh8.4 [~]expr {1/3}
0
tclsh8.4 [~]expr {1.0*1/3}
0.333333333333


Best regards, Alexey.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to