MySQL-如何连接两个将行转换为列的表
我在MySQL中有两个表,一个是application,另一个是application\u storefront。它们看起来像这样: 应用程序:MySQL-如何连接两个将行转换为列的表,mysql,join,view,Mysql,Join,View,我在MySQL中有两个表,一个是application,另一个是application\u storefront。它们看起来像这样: 应用程序: application_id | title ------------------------------------ 529479190 | Clash of Clans 553834731 | Candy Crush Saga 以及table application_storefront,即应用程序所
application_id | title
------------------------------------
529479190 | Clash of Clans
553834731 | Candy Crush Saga
以及table application_storefront,即应用程序所在的国家/地区:
application_id | country_code
--------------------------------
529479190 | USA
529479190 | GBR
529479190 | AUS
我想创建一个视图或一个新表,每个国家/地区代码作为一列,然后标记该应用程序是否在该国家/地区可用
application_id | title | USA | GBR | AUS | etc...
--------------------------------------------------------
529479190 | Clash of Clans | 1 | 1 | 0 | etc...
如何在MySQL中实现这一点?它通常被称为一个支点,世界上有196个国家。对于表列和按名称访问这些列,请记住这一点。那对我来说是不可能的