MySQL Forums
Forum List  »  Newbie

Can we do an inner join to 2 select statements?
Posted by: Gokul Ramanarayanan
Date: September 07, 2010 02:49AM

Hi,

I would like to know if you can do an "inner-join kind of thing" on 2 select statements. I have 2 select queries on the same 3 table. Both queries retrieve the same 5 columns, but on different 'where' conditions.

I would to know if something like this would work.

"SELECT id, date, name, age, sex
FROM table1, table2, table3
WHERE .......

INNER JOIN

SELECT id, date, name, age, sex
FROM table1, table2, table3
WHERE ....... "

The point is, I want to extract those ids from SELECT statement 1, that are there are also there in the 2nd SELECT statement.

A million thanks in advance!

Options: ReplyQuote


Subject
Written By
Posted
Can we do an inner join to 2 select statements?
September 07, 2010 02:49AM


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.