On Tue, 7 Mar 2017 20:26:41 +0100 Clemens Ladisch <clem...@ladisch.de> wrote:
> James K. Lowden wrote: > > Clemens Ladisch <clem...@ladisch.de> wrote: > >> Recursive CTEs make SQL Turing complete. > >> > >> But they cannot do everything. > > > > Isn't that a contradiction? > > Being able to emulate a Turing machine (or a register machine) means > that there exists _some_ representation of the data, but not that it > has the form you actually want. To get back to the pivot example: if > I want multiple columns, what use are thousands of rows that encode > the Turing machine's tape? I don't know. It's popular nowadays to posit that recursion makes SQL Turing-complete. While I accept any loop can be expressed as recursion, I cannot envision your pivot-table query without some form of dynamic SQL. How else to provide to the interpreter the names of the output columns? --jkl _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users