MySQL Forums
Forum List  »  Newbie

Select subselect syntax
Posted by: Andy Taylor
Date: May 11, 2005 11:07PM

I want to do a select max(maxid) from the following select statement, as one expression;

select max(id) as maxid from table1 UNION select max(id) as maxid from table2 UNION select max(id) as maxid from table3;

the following expression is wrong but conveys what I am trying to do:

select max(maxid) from (select max(id) as maxid from table1 UNION select max(id) as maxid from table2 UNION select max(id) as maxid from table3);

thanks
andy
PS I a musing microsoft access 97, hopefully your answer will help and i can work out the ms syntax from that

Options: ReplyQuote


Subject
Written By
Posted
Select subselect syntax
May 11, 2005 11:07PM


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.