codice:
select
  m.nome,
  m.cognome,
  (
    select group_concat( a2.societa separator '; ' ) from (
      select a2.societa
      from management m2
      inner join aziende a2 on ( m2.id_azienda = a2.id )
      where m2.name_key = m.name_key
    ) as tbl
  ) as company,
  m.name_key
from
  management m
  inner join aziende a on ( m.id_azienda = a.id )
where
  ( m.flg &32 or m.flg &64 )
Buongiorno, quella qui su è la query (semplificata) in questione. L'errore che restituisce è Unknown column 'm.name_key' in 'where clause'. In pratica nella where clause all'interno della subselect non mi riconosce m.name_key della query esterna... come posso fare?