右外连接ON 与 WHERE 的限制作用

select a.id,a.value,b.id,b.value
  from test a
  right outer join test b on  a.id = b.id and
 regexp_like(a.value, '[1|a]');


ID   VALUE                ID   VALUE
---- -------------------- ---- --------------------
1    1234560              1    1234560
2    1234560              2    1234560
3    1b3b560              3    1b3b560
4    abc                  4    abc
5    abcde                5    abcde
6    ADREasx              6    ADREasx
7    123  45              7    123  45
8    adc  de              8    adc  de
9    adc,.de              9    adc,.de
10   abcbvbnb             10   abcbvbnb
11   11114560             11   11114560
13   Alax                 13   Alax
15   Alaxendar            15   Alaxendar
17   axender              17   axender
18   axer                 18   axer
19   alender              19   alender
20   alander              20   alander


ID   VALUE                ID   VALUE
---- -------------------- ---- --------------------
21   Alaxnr               21   Alaxnr
                          16   Alexender
                          14   Alexr
                          23   rexnr
                          12   Alex
                          24   rlexn
                          22   Alexnr

24 rows selected.

select a.id,a.value,b.id,b.value
  from test a
  right outer join test b on  a.id = b.id where 
 regexp_like(a.value, '[1|a]');

ID   VALUE                ID   VALUE
---- -------------------- ---- --------------------
1    1234560              1    1234560
2    1234560              2    1234560
3    1b3b560              3    1b3b560
4    abc                  4    abc
5    abcde                5    abcde
6    ADREasx              6    ADREasx
7    123  45              7    123  45
8    adc  de              8    adc  de
9    adc,.de              9    adc,.de
10   abcbvbnb             10   abcbvbnb
11   11114560             11   11114560
13   Alax                 13   Alax
15   Alaxendar            15   Alaxendar
17   axender              17   axender
18   axer                 18   axer
19   alender              19   alender
20   alander              20   alander


ID   VALUE                ID   VALUE
---- -------------------- ---- --------------------
21   Alaxnr               21   Alaxnr


18 rows selected.

为什么会有这种区别呢

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值