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.
我有三个实体A,B,C。EntityA:属性:Id,名称关系:ABRelation(A-->>B)
EntityB:属性:Id,名称关系:BARelation(B-->A)BCRelation(B-->>C)
EntityC: RoleId CBRelation(C-->>B)
现在我需要从包含在 C 中的具有某些 RoleId = 23 的实体 A 中获取记录。
能否请您尽快帮助我。在此先感谢。
SELECT a.Id, a.Name, FROM EntityA a INNER JOIN EntityB b ON a.Id= b.EntityA_Id(foriegn key) JOIN EntityC as c ON b.EntityC_Id(foriegn key) = c.Id WHERE c.RoleId=23