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

how do I return a fixed number of rows in a query -reagrdless of nulls

Status
Not open for further replies.

vbrunner

Programmer
Apr 17, 2002
16
0
0
CA
Hi

I would like top return X number of rows from a query and sequentially number one of the fields regardless of matching the Where clause.

ie: I would like this to return 10 records (with the field Nbr numbered sequentially) even if no data matches &quot;Price <= 10&quot;:
Select Nbr, Type, Price
From Prod
Where Price <= 10
Group By Nbr
Order BY Nbr

Thanks in advance
I know I've done this before in stored procs but I can't remember right now where to find them (I'm not doing this in a stored proc anyway).
 
This thread is a duplicate of thread181-528502

Please do not post duplicate threads. People posting in one thread cannot see the responses you have already been given in the other.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top