Skip to content
Advertisement

SQL: Fetch additional column without adding in GROUP BY

I’ve a query:

I also want to fetch id column from asset_aud table in the resultset. But I do not want to add it in groupby , because it will then add a group condition w.r.t to id column.

So how can fetch id column as well without inflating the resultset?

Advertisement

Answer

Use an aggregation column:

or perhaps:

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement