gpt4 book ai didi

mysql - 该查询仅返回一个结果,应该返回两个

转载 作者:行者123 更新时间:2023-11-30 00:57:49 27 4
gpt4 key购买 nike

此查询应该返回两个 order_ids ..但只返回一个,并且 order_ids 满足查询条件...可能出了什么问题?

SELECT r.*
FROM products_to_products_extra_fields AS p
INNER JOIN orders_roster AS r ON p.products_id = r.products_id
INNER JOIN orders AS o on r.orders_id = o.orders_id
WHERE p.products_extra_fields_id = 14 AND
p.products_extra_fields_value between '2013-11-01' and '2013-11-30 23:59:59' AND
r.roster_status != 'Removed' AND
o.payment_method = 'Institutional Billing' AND
o.orders_status < 100001
GROUP BY o.orders_id
ORDER BY DECODE(o.cc_type, 'oFsAfHr7') ASC

最佳答案

尝试:

SELECT DISTINCTROW r.* ...

此外,还可以尝试使用 GROUP BY 子句,这可能会导致 orders_id 上的行折叠。

关于mysql - 该查询仅返回一个结果,应该返回两个,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20407885/

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