On Fri, 3 May 2013 07:45:25 +0900 Yongil Jang <yongilj...@gmail.com> wrote:
> I just implemented a simple code(User Defined Function) that returns a > number as like as row number. I considered writing such a function, too. I didn't because relations have no order. One might be tempted to say that's solved by ORDER BY. But 1. It's not clear that the rows are presented to the UDF in ORDER BY order. There's no reason they should be, and a few they shouldn't, including 2. Subqueries can't have ORDER BY, making the UDF non-deterministic by definition. Without new syntax, the only reliable way to produce "row numbers" is with a self-join, cf. http://www.schemamania.org/sql/#rank.rows. --jkl _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users