dcsimg
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

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


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

WEBINAR:

On-Demand

Building the Right Environment to Support AI, Machine Learning and Deep Learning


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