高级查询

连接查询
select *from info,nation 形成笛卡尔积
select info.code,info.name,info.Sex,nation.name,info.birthday from info,nation where info.nation=nation.code

select *from info join nation on info.nation=nation.code 关键字join 加入
联合查询 关键字:union
select code,name from info
union
select code,name from nation
子查询
无关子查询  
select *from info where nation=(select code from nation where name='汉族')
相关子查询
select * from car a where oil<(select avg(oil) from car b
 where b.brand=a.brand)

 

posted on 2016-10-17 15:56  奔跑的葛根  阅读(137)  评论(0)    收藏  举报

导航