1

Suppose I have the following table

Event 1 | Event 2
2       | 4
0       | 8
5       | 2

I then query this data like the following

select sum(`Event 1`) as EVENT1, sum(`Event 2`) as EVENT2 from events

Which produces

EVENT1 | EVENT2
7      | 14

How would I modify the above query to produce the following results?

EVENTS
EVENT1
EVENT1
EVENT1
EVENT1
EVENT1
EVENT1
EVENT1
EVENT2
EVENT2
EVENT2
EVENT2
EVENT2
EVENT2
EVENT2
EVENT2
EVENT2
EVENT2
EVENT2
EVENT2
EVENT2
EVENT2
user316114
  • 803
  • 7
  • 18
  • Look [here](http://stackoverflow.com/questions/17942508/sql-split-values-to-multiple-rows) for a hint. You can query out a CSV list of event values and then split it into separate records. – Tim Biegeleisen Apr 08 '16 at 15:11

1 Answers1

0

i think you can't do this in Mysql, but with postgres you can.