Re: [firebird-support] How do I limit an SQL search list to 10 records?

2019-12-13 Thread Clyde Eisenbeis cte...@gmail.com [firebird-support]
Good clarification. Any downside to using an auto increment number? ``` fiKeyID INTEGER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY ``` On Fri, Dec 13, 2019 at 12:15 PM Mark Rotteveel m...@lawinegevaar.nl [firebird-support] wrote: > > > On 13/12/2019 19:07, Clyde Eisenbeis

Re: [firebird-support] How do I limit an SQL search list to 10 records?

2019-12-13 Thread Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
On 13/12/2019 19:07, Clyde Eisenbeis cte...@gmail.com [firebird-support] wrote: > Is a field I create, or is it part of all records? It is a field you create. Which is why I wrote "Where is the table in question, and is a suitable column (eg a timestamp) to determine what the newest record

Re: [firebird-support] How do I limit an SQL search list to 10 records?

2019-12-13 Thread Clyde Eisenbeis cte...@gmail.com [firebird-support]
Is a field I create, or is it part of all records? On Fri, Dec 13, 2019 at 12:04 PM Mark Rotteveel m...@lawinegevaar.nl [firebird-support] wrote: > > > On 13/12/2019 16:48, Clyde Eisenbeis cte...@gmail.com [firebird-support] > wrote: > > One table contains history. The old history is never

Re: [firebird-support] How do I limit an SQL search list to 10 records?

2019-12-13 Thread Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
On 13/12/2019 16:48, Clyde Eisenbeis cte...@gmail.com [firebird-support] wrote: > One table contains history.  The old history is never replaced.  New > history is added.  What is relevant is the most recent history. Is there > a way to find the newest records without the KeyID? Yes, you do

Re: [firebird-support] How do I limit an SQL search list to 10 records?

2019-12-13 Thread Clyde Eisenbeis cte...@gmail.com [firebird-support]
One table contains history. The old history is never replaced. New history is added. What is relevant is the most recent history. Is there a way to find the newest records without the KeyID? On Fri, Dec 13, 2019 at 8:58 AM Mark Rotteveel m...@lawinegevaar.nl [firebird-support] wrote: > > >

Re: [firebird-support] How do I limit an SQL search list to 10 records?

2019-12-13 Thread Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
On 2019-12-13 12:48, Clyde Eisenbeis cte...@gmail.com [firebird-support] wrote: > I added the KeyID so I could sort from newest to oldest. Was it > necessary to add this KeyID, or is there another way to find the > newest records without the KeyID? That depends on what you're trying to achieve,

Re: [firebird-support] How do I limit an SQL search list to 10 records?

2019-12-13 Thread Clyde Eisenbeis cte...@gmail.com [firebird-support]
I added the KeyID so I could sort from newest to oldest. Was it necessary to add this KeyID, or is there another way to find the newest records without the KeyID? On Fri, Dec 13, 2019 at 2:05 AM Mark Rotteveel m...@lawinegevaar.nl [firebird-support] wrote: > > > On 2019-12-13 08:14, Kjell

Re: [firebird-support] How do I limit an SQL search list to 10 records?

2019-12-13 Thread Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
On 2019-12-13 08:14, Kjell Rilbe kjell.ri...@marknadsinformation.se [firebird-support] wrote: > Den 2019-12-12 kl. 22:36, skrev Clyde Eisenbeis cte...@gmail.com > [firebird-support]: >> Marcin, Minor tweak => works!  I also added DESC to retrieve the >> newest records using the field key name

Re: [firebird-support] How do I limit an SQL search list to 10 records?

2019-12-13 Thread Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
On 2019-12-12 19:59, Clyde Eisenbeis cte...@gmail.com [firebird-support] wrote: > This finds all records: > `` > "SELECT * FROM " + stTableName > > `` > > This does not work: > > `` "SELECT

Re: [firebird-support] How do I limit an SQL search list to 10 records?

2019-12-12 Thread Kjell Rilbe kjell.ri...@marknadsinformation.se [firebird-support]
Den 2019-12-12 kl. 22:36, skrev Clyde Eisenbeis cte...@gmail.com [firebird-support]: > Marcin, Minor tweak => works!  I also added DESC to retrieve the > newest records using the field key name (number is an auto increment). > ` > "SELECT FIRST " + stNumOfRecordsToRetrieve + " *

Re: [firebird-support] How do I limit an SQL search list to 10 records?

2019-12-12 Thread Clyde Eisenbeis cte...@gmail.com [firebird-support]
Marcin, Minor tweak => works! I also added DESC to retrieve the newest records using the field key name (number is an auto increment). ` "SELECT FIRST " + stNumOfRecordsToRetrieve + " * FROM " + stTableName + " ORDER BY " + fstKeyID + " DESC"; ` It's

Re: [firebird-support] How do I limit an SQL search list to 10 records?

2019-12-12 Thread 'Marcin Bury' marcin.b...@studio-delfi.pl [firebird-support]
Hi SELECT FIRST 10 * FROM A_TABLE Should work Cheers Marcin -- Wiadomość oryginalna -- Od: "Clyde Eisenbeis cte...@gmail.com [firebird-support]" Do: firebird-support@yahoogroups.com Data: 12.12.2019 19:59:44 Temat: [firebird-support] How do I limit an SQL search list to 10