What do you mean with groups ending and starting? The GROUP BY clause has the 
effect of returning one record per group (i.e. distinct tuple of the group 
expression), with the accumulated values belonging to that group. Each result 
record is therefore in a separate group.

SQLite will (except for special cases, where the GROUP BY and ORDER BY clauses 
can be satisfied by an index on the input rows) need to read ALL of the input 
rows before it can output even the first result row.

-----Ursprüngliche Nachricht-----
Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im 
Auftrag von Stephan Buchert
Gesendet: Montag, 29. Jänner 2018 16:19
An: sqlite-users@mailinglists.sqlite.org
Betreff: [EXTERNAL] [sqlite] Groups in C API

When processing SELECT ... statements having a GROUP BY clause, i.e.

SELECT ... GROUP BY ...;

in C, i.e. with a loop like

rc=sqlite3_step(stmt);
while rc==SQLITE_ROW {
   ...
   rc=sqlite3_step(stmt);
}

is there a way to know when a group ends and the next starts? I have this of 
course if the group by expression is also one of the result columns, but this 
is not always necessarily the case.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


___________________________________________
 Gunter Hick | Software Engineer | Scientific Games International GmbH | 
Klitschgasse 2-4, A-1130 Vienna | FN 157284 a, HG Wien, DVR: 0430013 | (O) +43 
1 80100 - 0

May be privileged. May be confidential. Please delete if not the addressee.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to