Posts by Gerson Júnior • 1 point
1 post
-
0
votes2
answers240
viewsA: How to sort a table according to data from another table
Complementing the answer of the colleague above (order by average): SELECT tb1.cd_tb1, AVG(tb2.vl_rating) as Media FROM tb1 LEFT OUTER JOIN tb2 ON (tb1.cd_tb1 = tb2.cd_tb1) GROUP BY tb1.cd_tb1 ORDER…