SELECT
    `pages`.`ID`,
    `pages`.`Language`,
    `pages`.`Module`,
    `pages`.`Action`,
    `pages`.`PostDate`,
    `pages`.`LastUpdate`,
    IF(`pages`.`MenuLabel` <> '', `pages`.`MenuLabel`, `pages`.`FooterLabel`) AS `Label`,
    IF(`Parent`.`URLLabel` IS NULL, `pages`.`URLLabel`, CONCAT(`Parent`.`URLLabel`, '/', `pages`.`URLLabel`)) AS `URLLabel`,
    `pages`.`Visible`
FROM
    `pages`
    LEFT JOIN `pages` AS `Parent` ON
        `Parent`.`ParentID` = 1 AND
        `pages`.`ParentID` = `Parent`.`ID` AND
        `pages`.`Language` = `Parent`.`Language`
WHERE
    `pages`.`Language` = 'bg'

