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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query 5 items from each vendor

Status
Not open for further replies.

nancier

MIS
Dec 27, 2004
50
US
I have a database of 20000 invoices made up of 150 vendors. Is there a way to query for 5 random invoices from each vendor? Of course if the vendor has only 4 invoices then it would only be possible to query for 4.

Thanks
 
If they don't need to be random you could use the TOP 5 clause in your SELECT statement....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top