How we can anyone document functions that do not exist?, they are
infinite and many of them (most) are not currently known to humanity.
Also, if somewhere it said "SQLite cannot do sqr() it would lie - sure
vanilla sqlite might not, but there are many ways in which it does.
!. Add-ons - there are many great sqlite add-ons (for lack of a better
word) via externally run-time loadable extensions.
See: https://www.sqlite.org/loadext.html
You can add any of this easily to your sqlite, or if you compile your
own, even add them to the source code. One great add-on is precisely the
math library that supports all (and more) of the mentioned functions.
Example extension via code:
From this Page: https://www.sqlite.org/contrib
extension-functions.c
<https://www.sqlite.org/contrib/download/extension-functions.c?get=25>
(50.96 KB) contributed by Liam Healy on 2010-02-06 15:45:07
Provide mathematical and string extension functions for SQL queries
using the loadable extensions mechanism. Math: acos, asin, atan,
atn2, atan2, acosh, asinh, atanh, difference, degrees, radians, cos,
sin, tan, cot, cosh, sinh, tanh, coth, exp, log, log10, power, sign,
sqrt, square, ceil, floor, pi. String: replicate, charindex,
leftstr, rightstr, ltrim, rtrim, trim, replace, reverse, proper,
padl, padr, padc, strfilter. Aggregate: stdev, variance, mode,
median, lower_quartile, upper_quartile.
Apart from that, you can add your own functions to sqlite (which may be
hard if you are working through a wrapper, but real easy if you access
the library or code directly).
See: https://www.sqlite.org/c3ref/create_function.html
Good luck and Happy SQLite-ing,
Ryan
On 2019/05/22 7:51 PM, sky5w...@gmail.com wrote:
I'm often scrambling to decide whether to do complicated queries in SQL or
my own code?
...Getting oh so close to a working query, only to fail at function not
defined?!!
Please add a note to the omitted page that many basic math functions are
NOT supported. (sqrt,mod,power,stdev,etc.)
https://www.sqlite.org/omitted.html
I am curious why these are not available when there are switches for much
larger search functions like FTS345?
...now reading how to build my own extensions...
Thanks for SQLite!
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users