Answer the question
In order to leave comments, you need to log in
SQL. How to combine two queries in this case?
Good afternoon.
There are 2 tables doctors and testt.
And I need to execute 2 requests. First in table testt by date:
SELECT * FROM testt WHERE '2018-05-13' BETWEEN date_in AND date_out
SELECT * FROM doctors, testt WHERE testt.sec = doctors.id
Answer the question
In order to leave comments, you need to log in
Learn SQL: join
SELECT
testt.*,
doctors.*
FROM testt
LEFT JOIN doctors
ON testt.sec = doctors.id
WHERE '2018-05-13' BETWEEN date_in AND date_out
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question