0

I have the following mysql table.

  a  | b  | c
1 a1 | b1 | c1

I would like to use a SQL query to create a table like the one below:

  time | sessionCnt
1 a    | a1
2 b    | b1
3 c    | c1

I tried this:

SELECT
  'a1' AS a,
  'b1' AS b,
  'c1' AS c
FROM dual;
Adrien Brunelat
  • 4,492
  • 4
  • 29
  • 42
hwkang
  • 1
  • 1

1 Answers1

0

Try this:

select 'a' as time, 'a1' as sessionCnt
union
select 'b', 'b1'
union
select 'c', 'c1';
Pavel Katiushyn
  • 795
  • 4
  • 9