文章的标签对应表
article_tag中就三个字段article_id、tag_id、status。
如下SQL语句的索引该怎么建最合理
select count(*) as s, article_id
from article_tag
where tag_id in (1, 2) and status = 1
group by article_id
having s = 2
order by article_id
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
走同样的路,发现不同的人生