SELECT *
FROM Activity AA
WHERE AA.act_id IN
((SELECT A.act_id
FROM Activity A
WHERE A.user_id = 'lhfcws')
UNION
(SELECT J.act_id
FROM Joinin J
WHERE J.user_id = 'lhfcws'))
ORDER BY AA.act_time
ERROR MESSAGE:
#1064 – You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use
near'UNION (SELECT J.act_id FROM Joinin J WHERE J.user_id =
'lhfcws')) ORDE' at line 7
Activity(act_id, user_id, act_name)
Joinin(act_id, user_id)
Hmm, don’t think you need such a subquery
sould do the same
maybe you need one more check
Acording to @Jonathan Leffler’s (true) remark