I need to create a select that takes the id's from two tables, unite them and show me the last record of the two together. I tried this way:
SELECT DISTINCT p.cod_mobilibus, p.nome, q.dt_acesso
FROM pr_pontos p
RIGHT JOIN pr_qr_pontos q ON p.cod_mobilibus = q.cod_mobilibus
ORDER BY q.dt_acesso DESC
My biggest problem is that the results I receive can not be the same.
Table 1 Structure
access_id / cod_mobilibus / dt_acesso
Table 2 structure
point_id / cod_mobilibus / name / address / city / neighborhood / code