| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: question using aggregate function
David Portas wrote:
> "Mia" <nospam_at_cox.net> wrote in message news:WC9ni.3$fK1.2_at_newsfe12.phx...
No - I haven't thought about using a correlated sub-query? Why complicate things?
SELECT DISTINCT Supplier_ID
FROM Orders
WHERE Order_Date = (SELECT MAX(Order_Date) FROM Orders);
Be prepared for it to return more than one row if more than one supplier places (or receives) an order on the same day.
-- Jonathan Leffler #include <disclaimer.h> Email: jleffler_at_earthlink.net, jleffler_at_us.ibm.com Guardian of DBD::Informix v2007.0226 -- http://dbi.perl.org/Received on Tue Jul 17 2007 - 22:57:04 CDT
![]() |
![]() |