|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I'm totally new to Firebird (as in, I just installed and downloaded ... oops, other way around ... this week).
My first gotcha: Other SQL databases have clauses like "top" and "limit" to restrict the size of the result set. Is there anything equivalent in Firebird? I'm using Firebird from Java with JayBird. In JDBC there's Statement.setMaxRows, which appears to do the job, but I'm a bit nervous about that: Is it actually passing that limit to the database engine? Or is the engine going to create a result set with a million rows and then JDBC is going to throw out all but the first 20, thus wasting time and memory all around? Similarly, I could create the result set and then just close it after processing the first twenty rows and ignore the rest, but again, do I still pay the performance penalty of the full result in such a case? |
|
#2
|
|||
|
|||
|
Hi,
I assume you're looking for the FIRST and SKIP clauses. They are used like this: SELECT FIRST X SKIP Y field1, field2, fieldn FROM ... etc. Fill in X and Y as appropriate. Think this was only introduced in firebird 1.5 though (not sure - definitely not an interbase feature). Hope this helps, Russ |
|
#3
|
|||
|
|||
|
Quote:
Oh, and SKIP is optional. Russ |
|
#4
|
|||
|
|||
|
Quote:
Ahhhh. Thanks. Funny how every database product I use, the SQL is just different enough to be confusing. It's like talking to someone from Australia, you think you should understand each other because you both speak English, and then he says something that just leaves you saying, Huh? |
![]() |
| Viewing: Dev Shed Forums > Databases > Firebird SQL Development > limit |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|