你这个a表是detail表对吧?,那么为什么会在a表存b和c的外键,而不是b和c表存a的外键?这样的话b.aId=a.id and c.aId=a.id就行了呗。