Website Sitemap
select pc.id, COALESCE(pco.meta_title, pc.meta_title) as meta_title, COALESCE(pco.url, pc.url) as url, pc.page_title as page_title FROM websites AS w INNER JOIN website_pages AS wp ON wp.website_id = w.id INNER JOIN page_content AS pc ON pc.id = wp.page_id LEFT OUTER JOIN page_content_owner AS pco ON pco.page_id = pc.id AND pco.website_id = w.id WHERE w.id = 68 order by page_title