teacher表:id、name、age、group_idbook表:id、name、description、teacher_id关系:一对多---------------------------------------------------------------------------------------------------------问题:我想 通过book的id查询到对应的book信息和teacher信息,他们之间在建立实体类的时候应该如何关联?
3 回答
浮云间
TA贡献1829条经验 获得超4个赞
select * from book where id = xxx; select * from teacher where id = (select teacher_id from book where id = xxx);
添加回答
举报
0/150
提交
取消