>VFP8 doesn't allow memo or general field in UNION. Would UNION ALL work for you in this case? It doesn't have such restriction.
When I assumed that, I change it to use the same approach as the GROUP BY. So, I only extract the IDs first and then do another SQL to get the rest.