0

I have a simple SQL query returning the count of each event in my dataframe. The problem is that the result is a flat datatable with each column representing the count of each event

example:

col_1   col_2   col_3   col_4
 10       9        15     12

I would instead like the data-table to be 2 columns with the label of the event and the count value associated with it

example:

col_1      10
col_2       9
col_3      15
col_4      12

This is the query I used to get my initial output:

select count(col_1) as col_1, count(col_2) as col_2,
count(col_3) as col_3,count(col_4) as col_4 
from table
Emm
  • 2,367
  • 3
  • 24
  • 50

0 Answers0