Skip to content

How to select a same column from a specialized table in PostgreSQL?

I have this table

Person table is a general table which has these 2 specialization:

I want to select data from physician and volunteer with the name of each person. Is there any possible way to do this?

Let’s say I have this example data:

Person:

IDPerson Name
P001 Andy
P002 Rudy
P003 Budy
P004 Khal
P005 Apho

Phycisian:

IDPhysician specialty
P004 heart
P005 brain

Volunteer:

IDVolunteer IDSupervisor skill
P001 P004 skill1
P002 P004 skill2
P003 P005 skill2

This is what I expect as an output:

Advertisement

Answer

Check if this works for you.

User contributions licensed under: CC BY-SA
10 People found this is helpful