Skip to content
Advertisement

Add new column to result and coalesce table

DB Fiddle

I want to run a query that:

a) adds a new column sub_event_type to the above table and
b) coalesce the table so all date values are in one column called event_date

The result should look like this:

In order to achieve this I tried to go with this query:

However, this query only displays sub_event_type delivered in the result.
I assume the reason for this issue ist that in the event_type stored all date values are in one row and in the event_types offered and stored they are in two seperate rows.

How do I have to modify my query to get the expected result?

Advertisement

Answer

I think you need union all:

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