How to make distinct sorts in tables with Left Join? [closed]

1

I need your next help.

First, see below my current query:

sq1 = mysqli($conexao,"select * from tabela1 TBL1 left join tabela2 TBL2 ON
         TBL1.codigo=TBL2.codigoestrangeiro LEFT JOIN tabela3 TBL3 ON
         TBL2.codigo=TBL3.codigoestrangeiro
         group by TBL1.codigo order by TBL1.codigo desc");

Table 2 and table 3 can contain n records bound to table 1. In this case, how do I call this information?

And how do I sort the information in a custom way, that is, table 2 should be displayed by name order, and table 3 by date.

    
asked by anonymous 01.08.2016 / 13:34

0 answers