SELECT witryna FROM config WHERE komponent = 'witryna' SELECT COALESCE(lang.title, lang_def.title) AS title FROM mainmenu_pozycja as item LEFT JOIN mainmenu_pozycja_lang as lang ON (item.id = lang.id AND lang.lang = '') LEFT JOIN mainmenu_pozycja_lang as lang_def ON (item.id = lang_def.id AND lang_def.lang = '') WHERE link = '' SELECT template,link FROM mainmenu_pozycja