Regardless of speed, you can't write like this:
SELECT * … GROUP BY client_id
According to the SQL rules for grouping, it is permissible to specify in the SELECT phrase fields from the GROUP BY + phrase aggregate functions from other fields. MySQL with some settings permits liberties, but this (a) can break down when transferred to another server and (b) gives an unwarranted result.
This task can be solved through a subquery, as it seems to me, with good performance:
SELECT c.* FROM `clients` AS c INNER JOIN ( SELECT DISTINCT `client_id` FROM `orders` WHERE `date` >= '2015-01-01' ) AS co USING(`client_id`)
(Here, instead of SELECT DISTINCT ... in the subquery you can apply ... GROUP BY client_id, will give the same result.)
https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_only_full_group_by
Edited : I carefully re-read the question and realized that I need to add a date to the subquery. With the advent of the aggregate function from GROUP BY is no longer dodge :)
SELECT co.`max_date`, c.* FROM `clients` AS c INNER JOIN ( SELECT `client_id`, MAX(`date`) AS `max_date` FROM `orders` WHERE `date` >= '2015-01-01' GROUP BY `client_id` ) AS co USING(`client_id`)
SELECT * FROM clients WHERE client_id IN (SELECT client_id FROM orders WHERE date >= '2014-01-01' GROUP BY client_id);performed much faster, but does not show the last order date. - ArchDemon