首页 > 解决方案 > 如何用快捷方式加入全名

问题描述

我有两张表,首先是国家的全名(只有一列):

Poland 
Germany 
Czech Republic

和带有这些名称的快捷方式的第二个表

PL
DE
CZ

如何将这两个表连接到一个有两列的表:国家和国家快捷方式?

Poland PL
Germany DE ect

标签: sqlms-access

解决方案


如果第一个表名为 country,则第二个表名为 abbr,第三个表名为 table3,从名称中查找缩写,它看起来像这样。

SELECT *
FROM country AS c
JOIN table3 as t3 on c.country = T3.country
JOIN abbr AS a on a.abbrivation = T3.abbrivation

推荐阅读