In a custom module, I needed to get the latest node that each user published. It is fairly easy to goup by users, but it needs a little something to actually accomplish the sorting.
The following query worked for me, we need to do the sorting in a nested select:
<?php
pager_query("SELECT * FROM (SELECT * FROM node order by created DESC) as node WHERE nid IN ($placeholders) GROUP BY uid",10,0,$count_query);
?>
In case the following error comes up:
Error: 1248 - SQLSTATE: 42000 ER_DERIVED_MUST_HAVE_ALIAS