一个单线我有这样的MySQL查询:从MySQL选择时仅本
SELECT a.full_address
FROM games_server AS a
JOIN orders_order AS b
ON b.server_id = a.id
WHERE service_type = 'color'
AND status = 'running' ORDER BY RAND()"
它完美细,并选择仅当SERVICE_TYPE是“颜色”的值。 但我需要的是,只有当只有一行service_type = color且没有其他行具有不同的service_type值时,才会选择'full_address'。因为对于一个full_address = a,可能有多行。例如。 full_address = a,service_type = color,同一个full_address = a,service_type = top。在那个特殊情况下,当它们中有两个时 - 它不能被选中。只有当有一行service_type = color时才有。
我希望任何人都能理解我说的话。对不起,如果我不能更清楚。
如果你发布一些样本数据和预期的输出,理解你的问题会更有帮助。 – Susang