a. =
       eg.
       Select A.a B.b from A, B where A.a=B.a and A.c=’herengang’;
     under this condition, it only shows the data that A.a=B.a and A.c=”herengang”.
   Although it there is data which .c is “herengang” ,but if we  can’t find such record which .a value equals to A.a in Table B, then it will be cleared.
 b.  left join
    select A.a, B.a 
    from table  A
             left join table B
            on  A.a =B.a and A.c=”herengang”
       under this condition, all of data which .c is “herengang” will be retrieved, and then if B.a exists, then show the value of B.a .

e.g Table A                                                Table B
      columnA columnB columnC              columnA columnB columnC    
           1            3            a                       1         'ok'     23.3
           2            4            b                       3          'sorry'    3.0

A join B (A inner B) ,result is 
     1       3        a      1     'ok'      23.3
A left join B, result is 
     1       3       a       1    'ok'       23.3
     2       4       b     null   null    null
A cross join B
      1       3       a      1    'ok'      23.3
      1       3       a      3   'sorry'   3.0
      2       4       b      1    'ok'      23.3
      2       4       b      3    'sorry'    3.0

相关文章:

  • 2021-06-13
  • 2021-12-31
  • 2022-12-23
  • 2022-12-23
  • 2021-12-08
  • 2021-08-09
  • 2021-05-06
  • 2021-04-28
猜你喜欢
  • 2021-04-03
  • 2022-03-08
  • 2021-11-04
  • 2021-09-24
  • 2021-09-19
相关资源
相似解决方案