Answer the question
In order to leave comments, you need to log in
How to do JOIN with BETWEEN condition?
There is 1 temporary table, contains sessions and their time:
id session_start session_end
132123 2020-04-29 11:02:02 2020-04-29 12:01:02
132123 2020-04-29 16:03:02 2020-05- 01 20:02:22
...
there are 2 tables - it contains queries with timestamps:
client query timestamp
132123 first_data 2020-04-29 16:03:32
321231 second_data 2020-04-29 16:03:33
312332 first_data 2020 -04-29 16:03:33
132123 third_data 2020-04-30 17:03:32
... It is
necessary to actually select records from 2 tables that satisfy the conditions:
1) client = id
2) the timestamp falls within the session period.
I think it is necessary to use JOIN here, but the correct request cannot be made.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question