Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2005
    Posts
    12

    Unanswered: display only the listing with the lowest price (was "Need a little help here.....")

    I have a little problem that I just haven't been able to solve. I don't think it is very difficult but I can't seem to make it work. Here's the scenario:

    I have a database with the following values:
    Model Make Price
    DA1100 GTN $88.00
    DA1100 GTN $100.00
    DA1000 GBN $110.00
    DA668 GTN $100.00
    DA880 GTN $200.00

    In this case DA1100 is listed twice with 2 different prices. I only want to display the one with the lowest price. So the result I want is:
    Model Make Price
    DA1100 GTN $88.00
    DA1000 GBN $110.00
    DA668 GTN $100.00
    DA880 GTN $200.00

  2. #2
    Join Date
    Jun 2003
    Posts
    269
    Code:
    select   Model,
             Make,
             min(Price) as MinPrice
    from UrTableName
    group by Model,
                 Make
    I love cursor,though I never use it.Cos' I dont want to misuse it.
    ----------------------------------------------

    ----cheers
    ----http://mallier.blogspot.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •