# 1 Grouping in Sql-Table

#### In this example, taking the box of invoice lines from the previous example, a grouping per album will be added in the output fields.

An adjustment is made on the SQL statement of the SQL-Table, adding the column 'album.title' to use it as a grouping.

Copy
<select>
<columns>
album.title,
track.trackid,
track.name,
invoiceline.unitprice,
invoiceline.quantity
</columns>
<from table='invoice'>
<join table='invoiceline'>
<on>invoiceline.invoiceid = invoice.invoiceid</on>
<join table='track'>
<on>invoiceline.trackid = track.trackid</on>
<join table='album'>
<on>album.albumid = track.albumid</on>
</join>
</join>
</join>
</from>
<where>
invoice.invoiceid = #invoiceid
</where>
<order>1</order>
</select>

The column 'title' is added to the output fields with the group parameter activated.

Result: