我已经阅读了所有相关的问题,但无法让这个简单的事情发挥作用。我想连接这个查询的结果:
SELECT DISTINCT ord.uid AS u
FROM `uc_order_products` ord_prod, `uc_orders` ord, `uc_roles_expirations` re
WHERE ord.order_id = ord_prod.order_id
AND ord_prod.title LIKE '2012. évi%'
AND ord.uid NOT
IN (SELECT uid FROM uc_roles_expirations re)
它看起来像这样:
U
----
1234
1235
...
这是我尝试过的:
SELECT GROUP_CONCAT(DISTINCT ord.uid AS u
FROM `uc_order_products` ord_prod, `uc_orders` ord, `uc_roles_expirations` re
WHERE ord.order_id = ord_prod.order_id
AND ord_prod.title LIKE '2012. évi%'
AND ord.uid NOT
IN (SELECT uid FROM uc_roles_expirations re) SEPARATOR ',')
..并没有工作。你可以帮帮我吗?