找回密码
 立即注册

推荐阅读

  • 便民服务
  • 关注我们
  • 社区新手

1、多表查询
内连接:select  * from aa inner join cc on aa.id=cc.s-id
左连接:select  * from aa left join cc on aa.id=cc.s-id
右连接:select  * from aa right join cc on aa.id=cc.s-id
基本连接:select  * from aa,cc where aa.id=cc.s-id
硬连接:select  * from aa union select  * from cc
2、查询张三的成绩:
临时表法:select score from (  )t where t.name='zhangsan'

             (  )中可以填: select * from aa inter/left/right  join on aa.id=cc.s-id
                                   select * from aa,cc where aa.id=cc.s-id
嵌套法:
              select score from cc where s-id=(select  id from aa where name='zhangsan' )
                                                      or
              select score from cc where s-id in(select  id from aa where name='zhangsan' )

基本连接:select score from aa,cc where aa.id=cc.s-id and name='zhangsan'




分享至 : QQ空间
收藏

0 个回复

您需要登录后才可以回帖 登录 | 立即注册