If you click the SQL Query link on the "Finding Beans" page you referenced, you will find an example of retrieving beans with custom queries at the bottom:
$sql = 'SELECT author.* FROM author
JOIN club WHERE club.id = 7 ';
$rows = R::getAll($sql);
$authors = R::convertToBeans('author',$rows);
So for your case, it might look something like:
$rows = R::getAll('SELECT *, max(DUP_NUMBER) as dup FROM table1 where CONTACTS=1 GROUP BY FIELD_A ORDER BY date LIMIT 3');
$all = R::convertToBeans('needle', $rows);
assuming 'needle'
is your bean type.