If I have the following table
Hour Clicks Conversions
12:00 2 0
1:00 3 2
2:00 1 1
How do I write a SELECT statment that dissaggrates it across both columns, so I get:
12:00 1 0
12:00 1 0
1:00 1 0
1:00 1 1
1:00 1 1
2:00 1 1
If I can’t do it with a SELECT, how do I write a stored proc that does it with a loop?
Thanks!
This assumes there will only ever be one row for any given value of
[Hour]. If there can be duplicates, I would aggregate those first (I assume the source is already an aggregation of some kind).