SELECT sf_page_node.Title_,
_url_parent =
CASE WHEN (sf_page_node_2.url_name_ = N'Pages') THEN '/'
ELSE
sf_page_node_2.url_name_ +'/'
END,
sf_page_node.url_name_ AS url_page
FROM
sf_page_node LEFT OUTER JOIN
sf_page_node AS sf_page_node_2
ON sf_page_node.parent_id = sf_page_node_2.id
WHERE (sf_page_node.root_id =
(
SELECT id FROM sf_page_node AS sf_page_node_1 WHERE (nme = 'FrontendSiteMap')
)
) AND
(sf_page_node.show_in_navigation = 1) AND
(sf_page_node.render_as_link = 1) AND
(sf_page_node.node_type = 0) AND
(sf_page_node.approval_workflow_state_ = N'Published')
Query 2:-
SELECT sf_page_node.title_ AS "Page Title", sf_sites.nme AS "Site"
FROM sf_page_node
JOIN sf_sites on sf_page_node.root_id = sf_sites.site_map_root_node_id
WHERE sf_site.nme = 'ProjectName'