1、博客表
标签表
每个博客可能对应多个标签,比如一篇博客中用到的技术有spring boot、mybatis等
现在根据标签的id,查出对应的标签的名称:
查询语句:
SELECT blog.title, blog.tag_uid, GROUP_CONCAT(tag.content) AS tagname FROM test_blog blog LEFT JOIN blog_tag tag ON FIND_IN_SET(tag.uid, blog.tag_uid) > 0 GROUP BY blog.uid
标签:blog,uid,标签,博客,逗号,tag,sql,id From: https://www.cnblogs.com/pangchunlei/p/17009707.html