I have two tables.
USER
USER_ID | USER_NAME
--------------------
659 | John
660 | Andrew
661 | Bianca
--------------------
USER_ADDRESS
USER_ID |TYPE | ADDRESS
------------------------------
659 | HOME | New York
659 | WORK | New Jersey
660 | HOME | San Francisco
660 | WORK | Fremont
------------------------------
I want to join multiple records from the 2nd table into a single row on the 1st table.
USER_ID | USER_NAME | HOME_ADDRESS | WORK_ADDRESS
--------------------------------------------------
659 | John | New York | New Jersey
660 | Andrew | San Francisco | Fremont
How do I get the above output in a select query?