Re: Need help with SQL statement!

From: Leader <sohelcsc_at_yahoo.com>
Date: 28 Jul 2003 23:21:17 -0700
Message-ID: <b1a93c73.0307282221.ce36363_at_posting.google.com>


"Alex" <sh2222_at_yahoo.com> wrote in message news:<_5lVa.117527$TJ.6968703_at_twister.austin.rr.com>...
> I am having difficulty writing a SQL statement and I was wondering if one of
> you gurus could help me. I have a table that has three fields: InvoiceID,
> Item, ItemPrice. Each InvoiceID is associated with one or more Items. I am
> trying to write a SQL statement that returns the record (all three fields)
> for the least expensive item for each invoice (so the total number of
> records returned will be equal to the total number of unique Invoice IDs.
> How would I write this SQL statement?
>
>
>
> Thank you,
>
>
>
> Alex

Hi,
I think you should try with Group by clauseand MIN function. it might help you.

Thanks
Hoque Received on Tue Jul 29 2003 - 08:21:17 CEST

Original text of this message