MySQL Forums
Forum List  »  General

select data from two tables without join statement !!
Posted by: khalid Al-Reemi
Date: April 15, 2014 09:17AM

Hi all
I need to join data from two tables but without using left join statement.
Ex: select t1.*,t2.* from t1,t2 where t1.id=t2.id;

The above statement shows only matched records from both tables.
BUT I need to select ALL records from t1 and matched records from t2.
For ex if t1 has 10 records and t2 matches t1 in 4 records only, then the result must show 10 records.

I don't want to use (LEFT JOIN), because I noticed that it takes longer time than using (WHERE) clause.
In oracle I could use: where t1.id(+)=t2.id
Ex: select t1.*,t2.* from t1,t2 where t1.id(+)=t2.id;

thanks.

Options: ReplyQuote


Subject
Written By
Posted
select data from two tables without join statement !!
April 15, 2014 09:17AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.