He guys, I have a problem, and I hope someone can help me. I have a date. For example, 2009-10-1. This date is used to check what season I work in. It can be in summer or winter.
If the table will be used in the summer for my internal connection, then it will be "summer09_rooms". If winter is 'winter09_rooms'. Therefore, as a rule, I want to do EVENT WHEN in my INNER JOIN. How to do it. The request will look like this:
SELECT name, arrival_date, departure_date FROM holliday a INNER JOIN ( CASE when arrival_date BETWEEN 2009-10-1 AND 2009-4-1 THEN summer09_rooms b ELSE winter09_rooms b END ) ON a.dossier=b.dossier
Of course, this query does not work, but now I hope you see what I want to achieve.
Respectfully,
Digital human
source share