MySQL is there a Single Select to Query Various Unrelated Values from a database?

Posted by zzapper on Stack Overflow See other posts from Stack Overflow or by zzapper
Published on 2010-03-10T21:49:27Z Indexed on 2010/03/12 11:37 UTC
Read the original article Hit count: 144

I saw somewhere what seemed to be nested selects, one "master" select on the "outside" and a series of selects inside- is this possible? I'm not talking about joins as there is particular relation between the selects.

I seem not to be explaining myself very well. I want to do a single query which will pull out a series of stats from various tables latest order, latest customer, largest order. Obviously I can do that with a series of selects.

The example I saw was something like

select (

 select ... from tbl_1 where ..,
 select ... from tbl_2 where ..,
 select ... from tbl_3 where ..,
 ...
)

© Stack Overflow or respective owner

Related posts about mysql

Related posts about multiple-select-query