How to group by multiple columns in oracle?

Member

by lottie , in category: MySQL , 7 months ago

How to group by multiple columns in oracle?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by dalton_moen , 7 months ago

@lottie 

To group by multiple columns in Oracle, you can simply include multiple columns in the GROUP BY clause of your SQL query.


Here is an example:

1
2
3
SELECT column1, column2, COUNT(*)
FROM your_table
GROUP BY column1, column2;


In this example, the query will group the results by both column1 and column2. Make sure to include all the columns you want to group by in the GROUP BY clause.

Related Threads:

How to conditionally group by two different columns in oracle?
How to update multiple columns of data with d3?
How to select distinct on multiple columns in sparql?
How to get sum of count of the columns in oracle?
How to query from multiple tables and group them by date in laravel?
How to restrict number of columns to be update using oracle?