Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> comp.databases.theory -> Re: Best way to do this query?

Re: Best way to do this query?

From: Cimode <cimode_at_hotmail.com>
Date: 15 Jan 2007 02:18:32 -0800
Message-ID: <1168856312.541187.60740@v45g2000cwv.googlegroups.com>

Marshall wrote:

> But suppose I also want to know the id and amount of that particular
> invoice?

Something like this should do...

select * from Invoices A
inner join
(
select invoiceid, max(date) as date1 from Invoices group by customerid ) B
on A.invoiceid = B.invoiceid and
A.date = B.date1

Hope this helps... Received on Mon Jan 15 2007 - 04:18:32 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US