MySql. How to use Self Join

后端 未结 3 1529
醉话见心
醉话见心 2020-12-10 05:17

I need to use Self Join on this table.

+------------+------+--------+
| Country    | Rank |  Year  |
+------------+------+--------+
|France      |  55  |  20         


        
3条回答
  •  离开以前
    2020-12-10 05:45

    Change a.Country = 'Turkey' to b.Country = 'Turkey'

    You have SELECT DISTINCT a.Country, but your condition is a.Country = 'Turkey'. Even if you do get multiple rows, they are filtered by the DISTINCT

提交回复
热议问题