Above the column headings of the [[Invantive Query Tool/Results|Results]] grid sits a bar which says "Drag a column here to group by that column": ![[20260904-qt-column-heading.png]] ## Grouping Dragging a column heading onto that bar groups the rows by the values of that column. Each value becomes a band which can be opened and closed, with the rows under it. Dragging a second column onto the bar groups within the first, and so on, which is how a question like "per municipality, per project phase" is answered without writing it as SQL. Dragging a column off the bar again removes that level of grouping. ## Grouping Against Aggregating Grouping in the grid keeps every row: the rows are put in bands rather than replaced by one row per value. A `group by` in the statement does replace them - the platform or the engine returns one row per group and the individual rows never arrive. Which of the two to use follows from the question: - to look at the rows of one value among many, group in the grid: everything stays there and the bands can be opened; - to count, add up or average over a large table, write the `group by` in the statement: the work is done where the data is and only the answer travels. See [[Invantive UniversalSQL/General/Grouping|Grouping]]. Grouping in the grid covers the rows retrieved so far, as sorting and filtering do. ## What It Carries Into A summary switched on for a column - the sigma on its heading - is repeated per band once the grid is grouped, so each band states its own count or total beside the one for the whole answer. An export follows the grouping: the document written by "Export to Microsoft Excel" or "Export to HTML" holds the bands as the grid shows them. A layout saved with "Display Layout" holds the grouping too, so the next answer with the same columns opens grouped the same way.