Skip to content
Advertisement

How to ungroup the grouped record based on count column using SQL

I have below data set obtained after group by dept and loc.

dept id loc count

100 a 2

300 c 1

I need out put like below

deptid loc

100 a

100 a

300 c

please help

Advertisement

Answer

Another option is to use Recursive Queries to get the desired result.

DB Fiddle Link: https://dbfiddle.uk/?rdbms=oracle_18&fiddle=0580680ecf0b47b4933e3a4731b62b4a

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