Subject | "First N" ignored within subselect??? |
---|---|
Author | Joe |
Post date | 2009-10-14T20:49:56Z |
I just ran into something bizarre.
The following query:
select first 10 custkey from customer where ....
returns 10 rows, as I'd expect. However, if I put that in a subselect, like:
select custkey from customer where custkey in
(select first 10 custkey from customer where ....)
This one returns 48 rows. Custkey is the primary key on the Customer table, so there can't be more than one customer with the same custkey.
So, it appears that when when the "first n" is within a subselect, it is ignored, as far as I can tell.
Is this a bug in Firebird? Or is there some legitimate reason that it was designed that way?
I am running Firebird 1.0 if that affects the answer.
-Joe
The following query:
select first 10 custkey from customer where ....
returns 10 rows, as I'd expect. However, if I put that in a subselect, like:
select custkey from customer where custkey in
(select first 10 custkey from customer where ....)
This one returns 48 rows. Custkey is the primary key on the Customer table, so there can't be more than one customer with the same custkey.
So, it appears that when when the "first n" is within a subselect, it is ignored, as far as I can tell.
Is this a bug in Firebird? Or is there some legitimate reason that it was designed that way?
I am running Firebird 1.0 if that affects the answer.
-Joe