MySQL Forums
Forum List  »  Newbie

Re: Select subselect syntax
Posted by: Felix Geerinckx
Date: May 12, 2005 12:51AM

Andy Taylor wrote:
> 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;

SELECT
GREATEST((SELECT MAX(id) FROM table1), (SELECT MAX(id) FROM table2), (SELECT MAX(id) FROM table3)) AS maxid;

Don't know about Access 97 though. Perhaps you can use a passthrough query if it doesn't work?

--
felix
Please use BBCode to format your messages in this forum.

Options: ReplyQuote


Subject
Written By
Posted
May 11, 2005 11:07PM
Re: Select subselect syntax
May 12, 2005 12:51AM


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.