0
SELECT prefixo FROM getVeiculosLinha AS V JOIN getLinhas AS L ON V.cod_linha = L.cod_linha JOIN tab_garagens AS G ON V.prefixo = G.onibus_prefixo
SELECT c.local FROM status AS s JOIN cadastro_pontos AS c ON c.onibus_ponto = s.onibus_ponto JOIN tab_garagens AS t ON t.onibus_prefixo = c.local WHERE data > (NOW() - INTERVAL 10 MINUTE) GROUP BY s.onibus_ponto
The two queries are distinct queries in which I would like to generate a third query with the data that NAY are duplicated; remembering that both have a common column (c.local and prefix) that bring the same information but from different places.
Friend, this change is occurring error on the part of Mysql, in the WITH line. I believe that Mysql, so I searched, no longer exists this command. But I don’t know how to do something more elaborate to make it work the way I need it.
– ygorroberto
https://dev.mysql.com/doc/refman/8.0/en/with.html#common-table-Expressions
– anonimo