PREFEITURA MUNICIPAL DE NANTES - SP
FECHAR
    Erro!

    # 1104 - The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay

    select * from (SELECT cid as n1cid, categoria as n1categoria, fromid as n1fromid FROM m_publiccategorias n1 where fromid = 0 ) as nivel1 LEFT OUTER JOIN (SELECT cid as n2cid, categoria as n2categoria, fromid as n2fromid FROM m_publiccategorias n1 where fromid <> 0 ) as nivel2 ON nivel1.n1cid = nivel2.n2fromid LEFT OUTER JOIN (SELECT cid as n3cid, categoria as n3categoria, fromid as n3fromid FROM m_publiccategorias n1 where fromid <> 0 ) as nivel3 ON nivel2.n2cid = nivel3.n3fromid LEFT OUTER JOIN (SELECT cid as n4cid, categoria as n4categoria, fromid as n4fromid FROM m_publiccategorias n1 where fromid <> 0 ) as nivel4 ON nivel3.n3cid = nivel4.n4fromid ORDER BY nivel1.n1categoria, nivel2.n2categoria, nivel3.n3categoria, nivel4.n4categoria