Re: [sqlite] LIMIT

2018-06-22 Thread sub sk79
> What would the window-function query be? Note: For anyone stumbling upon this thread, below code is not supported in SQLite natively. SELECT F1, F2 FROM ( SELECT F2, F1, Rank() OVER (PARTITION BY F2 ORDER BY F1 ) AS Rank FROM T )

Re: [sqlite] Question about hidden columns

2018-06-22 Thread Keith Medcalf
You know that you can use the hidden columns by name in the WHERE cause correct, and do not have to use function parameters? So the ext/misc/series.c in the repository defines a virtual table generate_series which effectively returns each "value" generated by the statement: for (value=start;

Re: [sqlite] LIMIT

2018-06-22 Thread Dan Kennedy
On 06/23/2018 03:52 AM, R Smith wrote: On 2018/06/22 10:04 PM, Gert Van Assche wrote: All, I'm sure it must be possible, I just don't find how. I have a table T with 2 fields (F1 and F2). The F1 are unique and the F2 are not unique. I would like to get only 10 F1 fields for each unique F2.

Re: [sqlite] LIMIT

2018-06-22 Thread R Smith
On 2018/06/22 10:04 PM, Gert Van Assche wrote: All, I'm sure it must be possible, I just don't find how. I have a table T with 2 fields (F1 and F2). The F1 are unique and the F2 are not unique. I would like to get only 10 F1 fields for each unique F2. This is not normally done, and

[sqlite] LIMIT

2018-06-22 Thread Gert Van Assche
All, I'm sure it must be possible, I just don't find how. I have a table T with 2 fields (F1 and F2). The F1 are unique and the F2 are not unique. I would like to get only 10 F1 fields for each unique F2. LIMIT 10 is the easy part... But how do I express the query so it F1 is LIMITed to 10 for

[sqlite] Question about hidden columns

2018-06-22 Thread Brandon Kyle Schmoll
Hello All, I am relatively new to sqlite and I have a question about using input parameters to constrain hidden columns in a query, described in section 2.1.2 here: https://www.sqlite.org/vtab.html#table_valued_functions The

Re: [sqlite] Unexpected sqlite3_trace_v2 sqlite3_expanded_sql output.

2018-06-22 Thread Lodewijk Duymaer van Twist
Hi Clemens and Richard, I have not read the SQLITE_TRACE_STMT documentation well enough they where triggers containt in (X).. Thanks. Lodewijk Van: "Clemens Ladisch" Aan: "sqlite-users" Verzonden: Vrijdag 22 juni 2018 12:19:18 Onderwerp: Re: [sqlite] Unexpected sqlite3_trace_v2

Re: [sqlite] Unexpected sqlite3_trace_v2 sqlite3_expanded_sql output.

2018-06-22 Thread Richard Hipp
On 6/22/18, Lodewijk Duymaer van Twist wrote: > > Is this normal explaiable behaviour or should I try to provide a repo? > It would be helpful if you could provide a repro. -- D. Richard Hipp d...@sqlite.org ___ sqlite-users mailing list

Re: [sqlite] A coredump when select with index

2018-06-22 Thread Richard Hipp
Please send: (1) The version number of SQLite that you are using. The output of "SELECT sqlite_source_id();" (2) Did you compile SQLite yourself? Have you made any modifications to the code? What platform are you running on? (3) Please send the complete schema of the database - the output of

Re: [sqlite] Unexpected sqlite3_trace_v2 sqlite3_expanded_sql output.

2018-06-22 Thread Clemens Ladisch
Lodewijk Duymaer van Twist wrote: > I'm tracing queries that my application makes using sqlite3_trace_v2 and > sqlite3_expanded_sql in the callback. The application uses sqlite 3.22.0. > > At some point the software will call sqlite3_exec with the following > statement: > BEGIN TRANSACTION; >

[sqlite] A coredump when select with index

2018-06-22 Thread Nick
My query is "SELECT x,y FROM t1 WHERE z=? COLLATE NOCASE". sqlite3Select-> sqlite3WhereBegin-> sqlite3WhereCodeOneLoopStart-> codeAllEqualityTerms-> sqlite3IndexAffinityStr And I found "Cannot access memory at address" when running pTab->aCol[x].affinity //in sqlite3IndexAffinityStr() x =

[sqlite] Unexpected sqlite3_trace_v2 sqlite3_expanded_sql output.

2018-06-22 Thread Lodewijk Duymaer van Twist
Hi, I'm tracing queries that my application makes using sqlite3_trace_v2 and sqlite3_expanded_sql in the callback. The application uses sqlite 3.22.0. At some point the software will call sqlite3_exec with the following statement: BEGIN TRANSACTION; DELETE FROM call_lists WHERE id = 11;