Re: [sqlite] Is there a way to return the row number? (NOT therowid)

2013-07-01 Thread Gabriel Corneanu
Hi, My opinion is a little different: a) of course the compiler needs to change the query program (only if "nrow" is requested/used) b) I don't know the internals, but I just can't believe that such a value could not be exported somehow c) I understand it would be non-standard; however there

Re: [sqlite] Is there a way to return the row number? (NOT therowid)

2013-07-01 Thread Hick Gunter
The problem is a) you must have a limit clause for the register to even be tallied b) the register is not part of the result set c) it would be a very incompatible change to SQL syntax d) there are other ways of achieving the same result, either in the caller or in a user written function

Re: [sqlite] Is there a way to return the row number? (NOT therowid)

2013-07-01 Thread Gabriel Corneanu
Then this register value is exactly the needed result. There is also the other syntax, "limit n, m"; you have to skip somehow "m" rows. Gabriel ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] Is there a way to return the row number? (NOT therowid)

2013-07-01 Thread Hick Gunter
For this application I would suggest: DROP TABLE IF EXISTS query_results; CREATE TEMP TABLE query_results (...); INSERT INTO query_results SELECT ORDER BY LIMIT ; SELECT rowid,* from query_results; DROP TABLE IF EXISTS query_results; SQLite implicitly assigns numerical ascending rowids to a

Re: [sqlite] Is there a way to return the row number? (NOT therowid)

2013-07-01 Thread Tony Papadimitriou
Thanks! (At least some understand what I mean!) And people giving examples of how it can be done in C (or Python, for me) or whatever language miss the point. We're not talking how it can be programmatically. This is easy!!! How does one do it via pure SQL is the real question. As for