JOIN with conditions that are not =
Hello!
Let's say I have query A (with week_start and week_end columns) and query B (with dates).
Is there a way to join query A and B using
ON b.date BETWEEN a.week_start AND a.week_end
or something similar? I tried typing stuff like that (dismissing the query builder) but had no luck...
-
Hi Gonzalo,
To join queries A and B you need to have a field that matches between the two queries. For something like this you will need to manipulate the data to create a field to join the data together. If you use Week(date) or date_format(Date, w-Y) it will create a new field which can match the other query.
Please sign in to leave a comment.
1 comment