Paradox Community

Items in pnews.paradox-programming

Subject:Re: TOP 5
Date:Tue, 21 Jul 2020 10:15:36 -0400
From:"Steven Green" <>
how many loops thru the process do you have to make? are others online when 
you do it?

sort D, grab top 5 and do whatever
(or view/end grab bottom 5)
rinse and repeat


Steven Green
Myrtle Beach, South Carolina, USA

Collectibles and Memorabilia
Vintage Lego Sets and Parts
- and Paradox support, too
"Kevin Zawicki"  wrote in message 

I have two tables A and B.
each has a unique part # column

There is item name table with the part # and then two tables with part #
and sub part #

M part# and info
A active   part#, subpart#
B retired  part#, subpart#

A list of parts, and one table with active subparts of the part, one table
with the retired subparts on the part.

subparts are unique and a subpart cannot be in both tables

each subpart "child table" has a date column
each part may have zero to many subparts in either table

I need to get the last x number (3-5) subparts by date from both tables.

If I have part 12345 and want the get the latest 5 entries by date and they
may be in A or B or both.

I can query and collect from both tables and then sort and grab top 5.

But this may put 100s of rows in the collection table just to get the top

Using QBE or local SQL is there a better way to get the latest 5?

Even if I get the latest 5 from A and latest 5 from B (if they have 5) then
latest 5 from collection it would be more efficient than getting the entire
set of subparts.

Is there a way to do TOP 5 in local SQL?

Copyright © 2004