SELECT a.*
FROM tableA AS a
LEFT JOIN tableC AS c
ON c.id = a.catid
LEFT JOIN tableD AS d
ON d.id = a.created_by
INNER JOIN tableE AS e
ON e.content_id = a.id
WHERE a.access IN (1,1,5)
AND c.access IN (1,1,5)
I am trying to use UNION ALL/ UNION operation instead of IN operation in SQL. I am having troubles to figure out how to convert the above query to use UNION. How Can I convert the above query to use UNION