gpt4 book ai didi

mysql - 为什么 SQL 查询在只有一行存在时返回两行?

转载 作者:太空宇宙 更新时间:2023-11-03 10:25:46 24 4
gpt4 key购买 nike

我已经编写了一个内部联接来从一个数据库中的三个表中提取信息。当我运行查询时,我返回了两行,第二行是第一行的副本。我希望只返回一行?

查询:

mysql> SELECT euroapps.id, euroapps.name, euroapps.imageurl, euroapps.website,
euroapps.developer, euroapps.description, euroapps.created, euroapps.iphone,
euroapps.ipodtouch, euroapps.ipad, app_detail.screen1 , app_detail.screen2,
app_detail.screen3, app_detail.screen4, application_price.retail_price
FROM euroapps INNER JOIN app_detail ON euroapps.id = app_detail.id
INNER JOIN application_price ON euroapps.id= application_price.application_id
WHERE euroapps.id = 353783927;

返回两行,而这个只返回一行(并且符合预期)

mysql> SELECT euroapps.id, euroapps.name, euroapps.imageurl, euroapps.website,
euroapps.developer, euroapps.description, euroapps.created, euroapps.iphone,
euroapps.ipodtouch, euroapps.ipad, app_detail.screen1 , app_detail.screen2,
app_detail.screen3, app_detail.screen4
FROM euroapps INNER JOIN app_detail ON euroapps.id = app_detail.id
WHERE euroapps.id = 353783927;

最佳答案

我认为您在 application_price 表中有两条记录,其中 euroapps.id = 353783927。

你能验证一下吗?

关于mysql - 为什么 SQL 查询在只有一行存在时返回两行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5821581/

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