Thanks Andy for taking the time,
civicrm_membership (a)
+----------+-----------------------+
| contact_id | membership_type_id |
+----------+-----------------------+
| 1 | 10 |
| 2 | 20 |
| 3 | 30 |
____________________________________
civicrm_contribution (b)
+----------+----------------+
| contact_id | receive_date |
+----------+----------------+
| 1 | 10-10-10 |
| 1 | 20-10-10 |
| 2 | 30-10-10 |
| 2 | 20-12-10 |
| 3 | 21-10-10 |
____________________________
SELECT a.membership_type_id, MAX(b.receive_date)
FROM civicrm_membership a
LEFT OUTER JOIN civicrm_contribution b
ON a.contact_id = b.contact_id
GROUP BY a.membership_type_id
Mark
> --
> You received this message because you are subscribed to the Google Groups
> "Joomla! General Development" group.
> To post to this group, send an email to joomla-de...@googlegroups.com.
> To unsubscribe from this group, send email to
> joomla-dev-gene...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/joomla-dev-general?hl=en-GB.
>