0

Here my table is like this

Leave_Type Leave_Balance

CL              12
PL              10

Now i want to display my data like below

Leave_Type_CL Leave_Type_PL Leave_Balance_CL Leave_Balance_PL

CL      PL      12          10
New Alexandria
  • 6,951
  • 4
  • 57
  • 77

1 Answers1

0

Try this:

SELECT CONCAT(
   group_concat(CONVERT(Leave_Type, CHAR(2)) separator ' '),
   ' ',
   group_concat(CONVERT(Leave_Balance, CHAR(2)) separator ' ')
) FROM Leave_Table;
Patrick
  • 38
  • 2
  • 5