Mysql 我将按列数';s值
我想得到一些职位的关键字与搜索(喜欢)条件。我的争吵比我想象的要多 我试过了,但没用, mysql5.7 x64Mysql 我将按列数';s值,mysql,distinct,Mysql,Distinct,我想得到一些职位的关键字与搜索(喜欢)条件。我的争吵比我想象的要多 我试过了,但没用, mysql5.7 x64 SELECT DISTINCT ct.id, ct.cat_link, pt.post_id, lng_ct.cat_title, pt.post_title, pt.post_link, pt
SELECT DISTINCT ct.id,
ct.cat_link,
pt.post_id,
lng_ct.cat_title,
pt.post_title,
pt.post_link,
pt.post_content,
pt.post_tags,
pt.post_description,
pt.post_author,
pt.post_image,
pt.post_date,
pt.post_cat_id
FROM `cates_of_site` AS ct,
en_posts_of_site AS pt,
`en_cat_info` AS lng_ct,
`en_subcates_of_site` AS sub_ct
WHERE (pt.post_description LIKE '%hello%'
OR pt.post_tags LIKE '%hello%'
OR pt.post_title LIKE '%hello%')
AND ct.id = sub_ct.parent_id
AND pt.post_cat_id = sub_ct.subcat_id
LIMIT 0,10
站点的en\u posts\u
表中只有一行。但我有7排。为什么?
站点的en_posts_:
站点的子类别:
en_cat_信息:
场地类别:
站点表的en_posts_中只有一行。但我有7排。为什么?首先,不要使用传统的连接语法。此外,由于要联接所有表,因此要根据联接的表乘以结果
如果不希望结果相乘,则需要使用exists。或者,可以考虑使用< <代码>组通过< /代码>进行重复删除。然而,Exists将更有效。请注意,没有ORDER BY的限制是毫无意义的