日期:2014-05-16  浏览次数:20524 次

db2中的连接查询,内连接、外连接、交叉连接
DB2 连接查询的学习:
[size=large]



首先创建三个表 student(id integer not null,name varchar(32),sex integer) ;

                            score(name varchar(32),score decimal);

                            grade(score double,grade varchar(2));

       学生表,分数表,等级表。




db2 => select * from student

ID          NAME                             SEX
----------- -------------------------------- -----------
          1 xiaoming                                   1
          2 vicky                                      1
          3 xiaohong                                   0
          4 xiaogang                                   1
          5 linlin                                     0
          6 xiaoyue                                    0
          7 manman                                     0
          8 penpen                                     1
          9 hanghang                                   1
         10 bingbing                                   0

  10 条记录已选择。






db2 => select * from score

NAME   &nbs