SELECT
DATE(datetime) AS date,
article,
price
FROM
client_prices_history
WHERE
(article, datetime) IN (
SELECT
article,
MAX(datetime) AS max_datetime
FROM
client_prices_history
GROUP BY
article, DATE(datetime)
);