Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Informix
Expertise: Beginner
May 23, 2000

Using OUTER , WHERE or Simply JOIN

Question:
Does it make a difference in placing an OUTER or simply a JOIN or a WHERE?

Using WHERE:

select tb01_field01,tbl01_field02
    from tb01,tb02  
    where tb01_field01 = tb02_field01
Using JOIN:
SELECT TB01_FIELD01,TB01_FIELD02  
    FROM TB01  
    JOIN TB02  
    ON TB01_FIELD01 = TB02_FIELD01
How do I use OUTER to do the same thing as the commands above? Is it faster with OUTER?

Answer:
Your second instance, "Using JOIN", is not valid SQL in Informix. It should be:

SELECT TB01_FIELD01,TB01_FIELD02  
    FROM TB01, TB02  
    WHERE TB01_FIELD01 = TB02_FIELD01
The OUTER statement only deals with what happens when one of the tables has rows that are not matched by the JOIN. It is probably a little slower than a regular JOIN, because it has to include rows that would not be returned in a non-OUTER join.
DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date