F
F
Fyodor2016-02-09 07:42:45
MySQL
Fyodor, 2016-02-09 07:42:45

How to get only the last record from the second table with Join?

The question is this - there is a table with clients - such as clientid, name, phone,
and there is a table with call records for these clients of type id, phone, datetime,
of course, there are many calls for each client.
The question is how to get the date of the last call in one request - datetime
Let's do a left join - after all, there will be lines with all the conversations ...
How can I do it? as I understand it, if a subquery is made so that the last conversation is requested for each client, it will affect performance very much, plus you need to filter by the date of the call.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question