Můžete se JOIN
dvě tabulky takto:
SELECT
p.ID,
p.post_title,
c.cat_nicename,
p.post_perma
FROM TBL_POSTS p
INNER JOIN TBL_CATEGORIES c
ON p.CategoryID = c.Cat_ID
WHERE p.published = '1'
AND p.page = '0'
ORDER BY p.ID ASC
LIMIT 50