arrow_upward
How to split column into multiple columns in Oracle sql
#1
House    ||    Occupied
----------------------------
house1   ||    1
house2   ||    0
house3   ||    1
house4   ||    1
house5   ||    1
house6   ||    0
....


To



Occupied house    ||    Unoccupied house  
----------------------------------------
house1                 ||    house2
house3                 ||    house6
house4                 ||  
house5                 ||  
....



#2
you know it's easier if you're going to ask in stack overflow for help since people there very active, & there's a documentation about that in oracles main page, it's weird that you're not that knowledgeable in sql are all most identical in most cases



#3
Take a look at the CASE EXPRESSION in the Oracle SQL Documentation

You could do something like:

Code:
SELECT
    CASE "OCCUPIED" WHEN 1 THEN "HOSUE" END AS OCCUPIED_HOUSE,
    CASE "OCCUPIED" WHEN 0 THEN "UNOCCUPIED" END AS UNOCCUPIED_HOUSE
FROM DB."TABLE_NAME";


Good luck