0
我正在做一些表的連接,並希望根據表中的ENUM列過濾結果,其值爲0,1。MySQL - 查詢返回不匹配的行
這是查詢。
SELECT dpc.`id` AS parent_id,
dpc.`name` AS parent_name,
cp.`id` AS child_id,
cp.`name` AS child_name,
cp.`stub` AS stub,
cp.`active` AS active,
caf.`aspect_id` AS aspect_id,
am.`name` AS aspects,
GROUP_CONCAT(nfw.`aspect_values`) AS aspect_childs
FROM `category_parent` AS cp
JOIN `deals_parent_cat` AS dpc ON cp.`parent_id` = dpc.`id`
JOIN `category_aspect_filters` AS caf ON caf.`cat_id` = cp.`id`
JOIN `aspect_master` AS am ON am.`id` = caf.`aspect_id`
LEFT JOIN `navigation_filters_weightage` AS nfw ON nfw.`cat_id`= cp.`id`
AND nfw.`aspect_id` = am.`id` AND cp.`active`="1"
GROUP BY parent_id,child_id,aspect_id
ORDER BY parent_name,cp.`order`,aspects
我已經把條件查詢返回只具有cp.active="1"
,其中有一個「0」值還是我得到列的結果。
這裏是輸出:
可以請你什麼可能是錯誤的查詢幫助。
它並沒有完全解決(分組的所有成果轉化爲一個),但對解決方案幫助。謝謝 – 2014-11-04 06:29:11
更新你的問題..發佈你的結果併發布你想實現什麼 – CodeSlayer 2014-11-04 06:33:05