sql - 如何用快捷方式加入全名
问题描述
我有两张表,首先是国家的全名(只有一列):
Poland
Germany
Czech Republic
和带有这些名称的快捷方式的第二个表
PL
DE
CZ
如何将这两个表连接到一个有两列的表:国家和国家快捷方式?
Poland PL
Germany DE ect
解决方案
如果第一个表名为 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
推荐阅读
- vb.net - 当 Progressbar.value = 最大值 | 我想自动重启
- django - 视图 formApp.views.formRegister 没有返回 HttpResponse 对象
- vue.js - Nuxt.config.js noscript innerHtml 在浏览器上呈现
- java - 如何更改 intellij IDEA 上特定代码行的字体?
- python - PermissionError: [WinError 5] 运行脚本时
- networking - SNMP 代理如何知道要读取哪个资源?
- excel - 如何在 Office JS 中使用 Excel.RangeAreas?
- azure-devops - Azure Pipelines - CI/CD:如何针对 DB 执行文件夹中的所有 .sql 文件
- javascript - 如何在 react.js 中获取代码输入作为组件
- python-3.7 - 如果存在,Django OneToOne Reverse Relation 会给出 RelatedObjectDoesNotExist