I need to make a query getting values from three tables. So, I'm using this:
SELECT
menussite.MSS_D1sMenu, menussite.MSS_CdiVertical,
verticais.VER_D1sVertical,
GROUP_CONCAT(submenussite.SSS_D1sSubMenuSite)
FROM menussite
LEFT JOIN verticais ON verticais.VER_CdiVertical = menussite.MSS_CdiVertical
LEFT JOIN submenussite ON submenussite.SSS_CdiMenuSite = menussite.MSS_CdiMenuSite
ORDER BY menussite.MSS_CdiMenuSite ASC
The problem is that some cells are empty and the query just showed the rows that totally matches with the query. What I need to do to query not ignore other results?
UPDATE
Here is a SQL Fiddle: http://sqlfiddle.com/#!2/11eabb/2
OUTER JOIN.