I have two table name 'activites' & 'archived_activities'. I devide my activities table record into another table record. Activities table contain only first 200 latest activities of users and remaining record moved to archived_activities table. Now I want to join both table only when activities table return null then I want to use same offset and limit for archived_activities table to fetch next record. Below I my query that is not working fine.
SELECT * FROM activities WHERE user_id=87 LIMIT 180,20
UNION ALL
SELECT * FROM activities WHERE user_id=87 LIMIT 180,20
But this query working not fine.
Any help?