Take the 2-minute tour ×  How does one filter a list of records
to remove those that have some identical fields, based on
selecting the one with the minimum value in another field? Note
that it's not sufficient to just get the minimum value... I need
to have other fields from the same record.  I have a table of
"products", and I am trying to add the ability to apply a coupon
code. Because of how the invoices are generated, selling a
product at a different cost is considered a different product.
In the database you might see this:  Product ID, Product Cost,
Product Name, Coupon Code     1,          20,          Product1,
null     2,          10,          Product1,    COUPON1     3,
40,          Product2,     null  I have a query that selects a
list of all products available now (based on other criteria; I'm
simplifying this a lot). The problem is that, for the above
case, my query returns:    1 - Product1 for $20   2 - Product1
for $10   3 - Product2 for $40  This gets shown to the customer
(assum