Mysql
 sql >> Database >  >> RDS >> Mysql

SQL seleziona i dati da più tabelle

Puoi farlo con un union all e group by :

select url,
       max(id1) as id1, max(id2) as id2, . . .
from ((select url, id as id1, NULL as id2, . . .  from table1) union all
      (select url, NULL as id1, id as id2, . . .  from table1) union all
      . . .
     ) t
group by url;