**已关闭。**此问题需要debugging details。当前不接受答案。
编辑问题以包含desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem。这将有助于其他人回答问题。
9小时前关门了。
Improve this question
欢迎大家我现在做一个查询,以获得一些结果从数据库(MYSQL),但结果总是回来不止一次,我不知道为什么.
Please kindly check this picture , it will help to understand the issue
调查情况如下。
SELECT DISTINCT
o_m.*,
o_c.id,
o_m.image AS mImage,
ccc.*,
f.name,
suppliersdb.username AS factory
FROM
order_marker o_m
JOIN order_cloths o_c ON
o_c.cloth_composition_id = o_m.cloth_id
JOIN fabric_usage f ON
o_c.usage_id = f.id
JOIN common_cloth_composition ccc ON
o_m.cloth_id = ccc.id
LEFT JOIN suppliersdb ON suppliersdb.id = ccc.suppName
WHERE
o_m.cloth_id = 231 AND o_m.order_id = 213;
有什么帮助吗?
1条答案
按热度按时间oxf4rvwz1#
您正在联接具有许多列(*)的许多表。其中一个表中的某些内容应该有所不同。请将查询限制在您需要的范围内,您应该会得到唯一的结果。