Creat Duplicate Rows Based on Value in Cell

General

Creat Duplicate Rows Based on Value in Cell

Hi All,

I have a (hopefully simple) Q - 

I want to create duplicate records based on the count in column #2 - 

ID Count
1234 4
3456 1
7890 3

Should look like - 

ID Count
1234 4
1234 4
1234 4
1234 4
3456 1
7890 3
7890 3
7890 3

Am able to replicate in excel but have a large dataset. I've tried using row_number() but am unable to resolve. Any help is much appreciated.

Thanks!

Sunny C.

1 REPLY

Re: Creat Duplicate Rows Based on Value in Cell

Hi:

Using a commodity table (CALENDAR) for a join or using a recursive query can be solutions for you.

HTH.

Cheers.

Carlos.