Internet Handholding posted on March 26, 2010 12:18
A common Sql problem is getting the first record of each set of records with a duplicate value in a column.
For example, suppose you have a set of orders with email addresses. You want to email each person, but you do not want to send them multiple emails.
Here is some Sql you can use to solve the problem.
By Andrew Weitzen, Bronze Inc. (c) 2010
Bronze is the publisher of several online Internet journals including: InternetHandholding.com, DomainNames.gs, DotNetNuke.bz, Programmer.bz, Software.vg, WebHosting.vg
select email, min(idorder) as idorder
from orders
group by email