我有一个看起来像这样的查询:
SELECT huxwz_user_orders.*, huxwz_users.name, huxwz_users.email, SUM(huxwz_user_orderitems.price)
FROM huxwz_user_orders
LEFT OUTER JOIN huxwz_users
ON (huxwz_user_orders.userid = huxwz_users.id)
LEFT OUTER JOIN huxwz_user_orderitems
ON (huxwz_user_orders.id = huxwz_user_orderitems.orderid)
WHERE huxwz_user_orders.id like '%20%'
Group BY huxwz_user_orderitems.orderid
ORDER BY huxwz_user_orders.id DESC
上面的查询返回 23 个结果。问题是,当我进行这样的查询时select * from huxwz_user_orders WHERE id LIKE '%20%' ORDER BY id DESC
,它会返回 20 个结果。
我究竟做错了什么?:/有人可以解决吗?