Converting COlumns into Rows

Database

Converting COlumns into Rows

I have approximately 120 regions and the data is as below

REGION CUSTOMERS SALES

A1 60 500
A2 50 400
..
..
..
..
..
..
A10 70 500

I want to convert it into the following format

REGION

A1 Customers 60
A1 SALES 500
A2 Customers 50
A2 SALES 400

Would be great if anybody know how to convert rows into columns

Thanks
Rajiv
1 REPLY

Re: Converting COlumns into Rows

Make sure data type for customers and sales are compatible (integer or decimal both)
SELECT
region
,'Customers' AS category
,customers
FROM temp1
UNION
SELECT
region
,'SALES'
,sales
FROM temp1
ORDER BY 1;