SQL Group By Order BY Descending on datetime column
<p>I have a <code>services</code> table with the following column-rows on a MySQL database</p>

<pre><code>`id`    `service_rendered`  `created_at`
 1       repair              2016-11-19 14:40:56
 2       install             2016-11-19 14:40:58
 3       repair              2016-11-19 14:44:27
 4       install             2016-11-19 14:50:35
</code></pre>

<p>I'm trying to count the number of services and the last date/time it was rendered. Column <code>created_at</code> is a datetime type.</p>

<p>The SQL statement that I'm running is:</p>

<pre><code>SELECT COUNT(`service_rendered`) as `count_service`, `service_rendered`, `created_at` as `last_rendered`
FROM services
WHERE `id` IN (1,2,3)
GROUP BY `service_rendered`
ORDER BY `created_at` DESC
</code></pre>

<p>But what I'm getting is:</p>

<pre><code>`count_service`    `service_rendered`  `last_rendered`
 2                  repair              2016-11-19 14:40:56
 1                  install             2016-11-19 14:40:58
</code></pre>

<p>How do I write my SQL so that I am able to get 2016-11-19 14:44:27 on repair?</p>