P
P
pcdesign2016-12-28 13:44:44
Flask
pcdesign, 2016-12-28 13:44:44

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


Can you please tell me how to convert it to SQLAlchemy?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2016-12-28
@dimonchik2013

https://chartio.com/resources/tutorials/how-to-exe...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question