Skip to content
Advertisement

Multiple tables joined to a table via single column

I am trying to create query, on below scenario.

enter image description here

with my skills I am able to join Table A,A1,B and A,A1,C and A,A1,D individually and union them.

Is there any better way to achieve same. I am using Oracle as Database.

Advertisement

Answer

It all depends on what they mean and if you need to know the columns the values are from.

This would get all the columns and you would have NULL values from the non-matching B, C, D tables:

Or, this would get only the relevant values and give you the type they belong to in fewer columns:

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