Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
所以这就是我要解决的问题。
Category(CatID(PK), CatName,....) Writer(wtrID(PK), CatID(FK), wtrName,....) Report(rpID(PK), title) Authors(rpID(FK),wtrID(FK))
如何创建一个列表来显示来自 3 个不同类别的作者的报告标题?
select r.title, group_concat(w.wtrID) as writer_ids from Reports r inner join Authors a on a.rpID = r.rpID inner join Writer w on w.wtrID = a.wtrID inner join Category c on c.CatID = w.CatID group by r.title having count(distinct c.CatID) = 3