I have a table consist of No Contract, Past, Current, and Expired columns.
|No.Cont| Past |Current|Expired|
+-------+------+-------+-------+
|113 | X | | |
|114 | | X | |
|115 | X | | X |
I want to transform the table into this
|No.Cont| Category|
+-------+---------+
|113 | Past |
|114 | Current |
|115 | Past |
|115 | Expired |
I was told to create array [Past, Current, Expired], then explode it. But, I don't understand the steps.
I'd really appreciate any help.
You can use
UNION ALLas follows: