Hi chetan,
Refer below sample.
DECLARE @TestDemo AS TABLE(Name1 VARCHAR(10),Name2 VARCHAR(10),Department1 VARCHAR(10),Department2 VARCHAR(10),Location1 VARCHAR(10),Location2 VARCHAR(10))
INSERT INTO @TestDemo VALUES('Jhon','Alex','IT','Marketing','London','Seattle')
INSERT INTO @TestDemo VALUES('Mark','Dan','Sales','R&D','Paris','Tokyo')
SELECT Name1 'Name',Department1 'Department',Location1 'Location' FROM @TestDemo
UNION ALL
SELECT Name2 'Name',Department2 'Department',Location2 'Location' FROM @TestDemo
Output
Name |
Department |
Location |
Jhon |
IT |
London |
Mark |
Sales |
Paris |
Alex |
Marketing |
Seattle |
Dan |
R&D |
Tokyo |