Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pull second record of an ordered set.... 1

Status
Not open for further replies.

flaniganmj

Technical User
Jun 25, 2002
81
US
Howdy,

How can I pull (SQL) the second record of an ordered set? Example:

Vendor Invoice No
1 1
1 2
1 3
2 4
2 5
2 6

I need have return something like this:

Vendor Invoice No
1 2
2 5

Any help?

flan
 
Code:
select vendor,Min(InvoiceNo)
  from t as q
 where invoiceNo > (select min(invocieNo) from t
  where vendor = q.vendor)
 group by vendor
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top