내가 아래에있는 내 코드를 사용하여 동일한 범주 또는 항목의 두 따기 피하기 위해 노력하고 ...mysql을 작동하지 않는 별개의
그 작업을 잘하지만, 아주 가끔이 표시 중복 카테고리 ...
SELECT DISTINCT
exp_categories.cat_id, exp_categories.cat_name, exp_categories.cat_url_title
,exp_category_posts.entry_id, exp_channel_titles.status
FROM (exp_categories
LEFT JOIN exp_category_posts
ON exp_categories.cat_id = exp_category_posts.cat_id)
LEFT JOIN exp_channel_titles
ON exp_category_posts.entry_id = exp_channel_titles.entry_id
WHERE exp_categories.group_id = 2
AND exp_category_posts.entry_id IS NOT NULL
AND exp_channel_titles.status = 'open'
GROUP BY exp_categories.cat_id
ORDER BY RAND()
LIMIT 2
카테고리가 여러 번 표시 될 때 모든 열이 동일한 값을 표시한다는 점이 긍정적입니까? –
어떻게해야할까요? 간단한 단어로 무엇을 보여 주길 원하십니까? –
mmmm 확인하고 2 초 후에 돌아옵니다 – Andy