这个查询应该返回两个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
答案 0 :(得分:0)
尝试:
SELECT DISTINCTROW r.* ...
另外,试用GROUP BY
子句,这可能导致行在orders_id
上崩溃。