Skip to content
Advertisement

Query holiday from column with condition

I will explain with tables result. I have a table “emp” which consists of columns (number of employee”id_emp” ,”date” and ‘”type”):

And I have another table “holiday” like this:

The result I want must be like this:

I tried to do something like this but it gives the wrong result:

Advertisement

Answer

I would unpivot the holiday records. So:

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