【发布时间】:2021-03-04 14:15:23
【问题描述】:
我正在尝试将两个表合并到一个基础上:
app.custid = fin.custid and
app.appdate = fin.findate and
app.price = fin.pricx
什么都不等于创建一个新表。这两个表没有关系。
Table app
appid custid appdate price
1 1 10/10/20 20
2 2 10/10/20 10
3 1 11/10/20 30
4 3 12/10/20 20
5 1 13/10/20 20
Table fin
finid custid findate pricex
1 1 10/10/20 20
2 2 11/10/20 10
3 1 11/10/20 20
4 3 12/10/20 20
5 1 13/10/20 20
输出:
Table app-new
appid custid appdate price pricex
1 1 10/10/20 20 20 => same custid, appdate=findate, price=pricex
2 2 10/10/20 10 null => same custid, appdate not the same findate
3 1 11/10/20 30 null => same custid, appdate=findate, price is not the same pricex
4 3 12/10/20 20 20 => same custid, appdate=findate, price=pricex
5 1 13/10/20 20 20 => same custid, appdate=findate, price=pricex
Table fin-new
finid custid findate pricex
2 2 11/10/20 10
3 1 11/10/20 20
【问题讨论】:
-
您是否在进行查询,该查询将为您提供这些结果以供其他软件或其他查询使用 - 或者您是否真的想要复制将数据输出到 Access DB 文件中的新物理表中?
-
@Dai 更容易更正确。查询或表与我是堆栈相同...
-
appid 和 finid 呢?他们不应该也匹配吗?
-
@forpas 不匹配。我只解释了 3 列。