pivot row into column
In my table data is in this format. Table Name: Transaction_Status
Select Id, Column1, Column2, Column3, Column4, Column5
from Transaction_Status;
How can convert columns into rows((Other than sub-query). so, that we can create a loop based on column status of the value is 'Y'. Otherwise we have to to write a subquery with same table multiple times.