Create a pivot table from table in the database- create chart by grouping data

Found a fix on this topic: use :group by

You may ignore the request, thanks