Answer the question
In order to leave comments, you need to log in
How to translate such a query into Flask-SQLAlchemy?
Here is the sql query:
SELECT a.*, b.*,
(SELECT max(date_call) from call_history WHERE client_id = a.id) as last_call,
(SELECT call_date from call_remind WHERE client_id = a.id) as call_remind
FROM clients a
INNER JOIN contacts b
WHERE
a.user_id = 208
AND
a.id = b.client_id
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