Page is a not externally linkable
LifeinAsia - 11:38 pm on Dec 29, 2012 (gmt 0)
This is where a JOIN is your friend. :)
You could join the first 2 results as follows:
SELECT ur.user_id, uc.contact_id
FROM user_reg ur INNER JOIN user_contacts uc ON ur.user_id=ud.user_id
WHERE ur.year='2012' AND ur.end_date IS NULL
You can join the 3rd result set using the same logic.