I have a select that it fetches data from three different tables, but has some fields in common between these three tables. My question is how to get the data from this field, which has the name in common with the other tables.
My select looks like this:
SELECT suporte_cad.reg,suporte_cad.data,suporte_cad.status,
suporte_cad.nmcontato, suporte_cad.mensagem ,
serv_cad.nmgrupo,serv_cad.dsservico, suporte_det.reg,
suporte_det.data, suporte_det.nmContato, suporte_det.nmUsuario,
suporte_det.mensagem
FROM suporte_cad,serv_cad,suporte_det where cnpj='$getCnpj'
and suporte_cad.idservcad=serv_cad.idservcad and suporte_det.reg='$reg'
and suporte_cad.reg = '$reg'
I want to get the message field of the tables support_dec and support_det