P.S :
http://www.itpub.net/861853,1.html[@more@]
SQL> select * from v_test;
ID NAME
---------- ----------
120 hospital
SQL> select * from v_test_1;
ID G
---------- -
120 M
110 F
SQL> select a.id,a.name from v_test a
2 where exists (select null from v_test_1 b where b.id = a.id);
ID NAME
---------- ----------
120 hospital
SQL> select a.id,a.name from v_test a
2 where exists (select null from v_test_1 b where b.id <> a.id);
ID NAME
---------- ----------
120 hospital
SQL> select a.id,a.name from v_test a
2 where exists (select null from v_test_1 b where b.id = 1);
no rows selected
SQL> select a.id,a.name from v_test a
2 where exists (select null from v_test_1 b where b.id <> 1);
ID NAME
---------- ----------
120 hospital
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/10484922/viewspace-975038/
,如需转载,请注明出处,否则将追究法律责任。