0

I have a data in the table in 1 column with Sectors and countries ..I need to pull sectors in one column and countries in another..Here is the sample data ..Any help is highly appreciated

TYPE    DATA

SECTOR IT
SECTOR Retail   `` 
SECTOR MF`
SECTOR us
region eUROPE
region ASIA

Convert into

Type DataSector   DataCountry
Sector IT         null
Sector Retail     null
sector MF         null
region  null           Us
region null       asia

1 Answer 1

1
SELECT  Type, 
        DataSector  = case when Type = 'SECTOR' THEN Data END, 
        DataCountry = case when Type = 'REGION' THEN Data END
FROM    The_Table
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.