> ## Documentation Index
> Fetch the complete documentation index at: https://docs.baenninger.me/llms.txt
> Use this file to discover all available pages before exploring further.

# Gruppieren

Das `GROUP BY`-Statement gruppiert Datensätze mit den gleichen Werten.Es wird oft zusammen mit Aggregatsfunktionen genutzt, um das Resultat zu gruppieren.

```sql theme={null}
SELECT column_name(s)
FROM table_name
WHERE condition
GROUP BY column_name(s)
ORDER BY column_name(s);
```

### Beispiel

```sql theme={null}
SELECT COUNT(*), Country
FROM Customers
GROUP BY Country
ORDER BY COUNT(*) DESC;
```
