Q:

How to write a query to show data from table in custom format in Sql Server 2005?

I have one table in my database as shown below.

So I want to write a query which will return me a table data like below.

A:

SELECT EmpId, EmpName, CatalogName, Training1 AS Training
FROM myTable
UNION ALL
SELECT EmpId, EmpName, CatalogName, Training2 AS Training
FROM myTable
UNION ALL
SELECT EmpId, EmpName, CatalogName, Training3 AS Training
FROM myTable
ORDER BY EmpId, Training

SQL Fiddle example

