Mysql (二) 复杂查询
https://www.cnblogs.com/Soprano/p/10659101.html
https://www.jianshu.com/p/c9b95e35999e
https://www.cnblogs.com/sugartang/p/10967435.html
1子查询 先查询 tb_content 表中category_id 最小的,然后在查询与 parent_id想等=或者包含IN的tb_content_category表的信息
SELECT * FROM `tb_content_category` tb2 WHERE tb2.parent_id=(SELECT min(tb1.category_id)FROM `tb_content` tb1);
或
SELECT * FROM `tb_content_category` tb2 WHERE tb2.parent_id IN (SELECT min(tb1.category_id)FROM `tb_content` tb1);
2 子查询