如果用这种方式,那要显示1 变型金刚这部电影,在typeid这里显示的动作和科幻类型,如何查询显示出来哦。因为其他信息都是一样的,这样为了一个影片类型,会不会冗余度太高了啊。
[/Quote]
1.LEFT JOIN:
select att.typeName from 属性表 att left join 电影表 m on att.typeid = m.typeid
where m.movieID=1
2.子查询:
select typeName from 属性表 where typeid in (select teypid from 电影表 where MovieID=1)