MySQL Forums
Forum List  »  MyISAM

Result Set Differentiation..!!
Posted by: Saurabh Arora
Date: March 02, 2012 04:49AM


We are trying to get the result sets as follows -

select (

select col1, col2, col3 from db.tbl where condition) as rsdb1 ,

(select col1, col2, col3 from db.tbl2 where condition) as rsdb2 ,

(select col1, col2, col3 from db.tbl3 where condition) as rsdb3 ,

(select col1, col2, col3 from db.tbl4 where condition) as rsdb4

after we get the results, we count the rows and display which has maximum count.

WHAT we were doing before -> get the count of all tables, then fire the query to get the RS. But the query written above gives the error as we can only select 1 column how is it possible to get the data from 4 tables into 1 query where we can differentiate the resultsets.

Options: ReplyQuote

Written By
Result Set Differentiation..!!
March 02, 2012 04:49AM
March 04, 2012 06:58PM

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.