Subject | Problem with FIRST x SKIP y |
---|---|
Author | salisburyproject |
Post date | 2005-03-28T13:16:35Z |
Hi,
I am trying to use the FIRST x SKIP y syntax and I see some strange
problem:
The SELECT without FIRST,SKIP returns 6070 rows. Here is example of
the select:
select distinct messages.*, msg_to.to_email, msg_to.to_name,
msg_to.to_type from messages,msg_to where (messages.common_id =
msg_to.common_id) order by messages.msg_key asc, msg_to.to_type desc
All rows have unique ID (msg_key), incremented for each row. No
missing rows.
Then, using syntax like:
select first 10 skip 10 distinct messages.*, msg_to.to_email,
msg_to.to_name, msg_to.to_type from messages,msg_to where
(messages.common_id = msg_to.common_id) order by messages.msg_key
asc, msg_to.to_type desc
works fine (e.g. returns records 11 to 20).
But this (note the skip 100):
select first 10 skip 100 distinct messages.*, msg_to.to_email,
msg_to.to_name, msg_to.to_type from messages,msg_to where
(messages.common_id = msg_to.common_id) order by messages.msg_key
asc, msg_to.to_type desc
returns records 76,77,78 - yes, only three records.
Using values 30, 600, returns rows 176 to 182 - total of 7 rows...
FB is superserver 1.5.2. I am using the Firebird ODBC driver, latest
version.
Any ideas?
Thanks!
Kiril.
I am trying to use the FIRST x SKIP y syntax and I see some strange
problem:
The SELECT without FIRST,SKIP returns 6070 rows. Here is example of
the select:
select distinct messages.*, msg_to.to_email, msg_to.to_name,
msg_to.to_type from messages,msg_to where (messages.common_id =
msg_to.common_id) order by messages.msg_key asc, msg_to.to_type desc
All rows have unique ID (msg_key), incremented for each row. No
missing rows.
Then, using syntax like:
select first 10 skip 10 distinct messages.*, msg_to.to_email,
msg_to.to_name, msg_to.to_type from messages,msg_to where
(messages.common_id = msg_to.common_id) order by messages.msg_key
asc, msg_to.to_type desc
works fine (e.g. returns records 11 to 20).
But this (note the skip 100):
select first 10 skip 100 distinct messages.*, msg_to.to_email,
msg_to.to_name, msg_to.to_type from messages,msg_to where
(messages.common_id = msg_to.common_id) order by messages.msg_key
asc, msg_to.to_type desc
returns records 76,77,78 - yes, only three records.
Using values 30, 600, returns rows 176 to 182 - total of 7 rows...
FB is superserver 1.5.2. I am using the Firebird ODBC driver, latest
version.
Any ideas?
Thanks!
Kiril.