Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

...

BeforeAfter
select * from t1 where EXISTS
(select null from t2 where t2.key=t1.key);
select * from t1 where t1.key IN
(select t2.key from t2);
select * from t1 where NOT EXISTS
(select null from t2 where t2.key=t1.key);
select * from t1 where t1.key NOT IN
(select t2.key from t2 where t2.key is not null);

select * from t1 where t1.key IN
(select t2.key from t2);

select * from t1 where EXISTS
(select null from t2 where t2.key = t1.key);

select * from t1 where t1.key NOT IN
(select t2.key from t2 where t2.key is not null);

select * from t1 where NOT EXISTS
(select null from t2 where t2.key = t1.key);

select * from t1 where NOT EXISTS
(select null from t2 where t2.key = t1.key);

select t1.* from t1, t2 where t1.key = t2.key(+) and t2.key is null

select * from t1 where t1.key
NOT IN
(select t2.key from t2 where t2.key is not null);

select t1.* from t1, t2 where t1.key = t2.key(+) and t2.key is null;

select column BETWEEN X AND Yselect (column <= X AND column >= Y) 
select column NOT BETWEEN X AND Yselect (column < X AND column > Y) 
select (column<= X AND column >= Y)select column BETWEEN X AND Y
select (column < X AND column > Y)select column NOT BETWEEN X AND Y

select t1.* from t1, t2 where t1.key = t2.key and t2.col = 10;

select t1.* from t1,

(select * from t2 where t2.col = 10) inline_alias where t1.key= inline_alias.key;

For DB2 and Oracle only

select t2.* from t1, t2 where t1.key = t2.key and t1.col is null

select * from t2 where t2.key IN

(select t1.key from t1 where t1.col is null )

-ignoreLegal
scroll-ignore
scroll-pdf
true
scroll-officetrue
scroll-chmtrue
scroll-docbooktrue
scroll-eclipsehelptrue
scroll-epubtrue
scroll-htmltrue
Newtabfooter
aliasIDERA
urlhttp://www.idera.com
 | 
Newtabfooter
aliasProducts
urlhttps://www.idera.com/productssolutions/sqlserver
 
Newtabfooter
aliasPurchase
urlhttps://www.idera.com/buynow/onlinestore
 | 
Newtabfooter
aliasSupport
urlhttps://idera.secure.force.com/
 | 
Newtabfooter
aliasCommunity
urlhttp://community.idera.com
 
|
 
Newtabfooter
aliasResources
urlhttp://www.idera.com/resourcecentral
 | 
Newtabfooter
aliasAbout Us
urlhttp://www.idera.com/about/aboutus
 
Newtabfooter
aliasLegal
urlhttps://www.idera.com/legal/termsofuse
Automate SQL tuning and profiling with DB Optimizer. Learn more > >
IDERA WebsiteProductsPurchaseSupportCommunityAbout UsResources