gpt4 book ai didi

sql - 在sqlite中联接具有不同列名但值相同的表

转载 作者:行者123 更新时间:2023-12-03 17:43:38 25 4
gpt4 key购买 nike

我正在使用SQLite处理我的数据库

我有两个不同的表,键列的名称不同,但值相同。

因此:

shoes
Identification | Name | Shoe size
1 Bob 10
2 John 12


payment
PaymentID | Price | Year
1 20 2013
2 38 2015


我需要

Identification(or PaymentID, no matter) | Name | Shoe size | Price | Year
1 Bob 10 20 2013
2 John 12 38 2015


我一直在搜索,并试图理解教程无济于事。我想我太傻了

最佳答案

select s.identification, s.name, s.`shoe size`, p.price, p.year
from shoes s
join payment p on p.paymentid = s.identification

关于sql - 在sqlite中联接具有不同列名但值相同的表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28456847/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com