On 8 Jul 2014, at 11:11pm, Hinrichsen, John <[email protected]> wrote:
> This > applies when creating a table using a SELECT where a column is the result > of an expression (such as min, max, or sum) or within a CTE (in the example > provided, where the expression can obviously only produce integers.) > > [snip] > > If SQLite (optionally?) permitted us to avoid writing these casts, by > automatically deducing the correct column affinity, it would correctly make > use of indices created, which would benefit everyone. Okay. So the problem is with sub-SELECT which produces values without affinities. What you want is for MIN() and MAX() to have the same affinity as the value they choose, and for SUM() to have an affinity of REAL. Thanks for the explanation. So now I'm interested to know whether functions created with sqlite3_create_function() return a value with an affinity or just a value. Simon. _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

