Subject | Re: [firebird-support] Re: Problem with FIRST x SKIP y |
---|---|
Author | Pavel Menshchikov |
Post date | 2005-03-29T13:37:19Z |
Hello Kiril,
s> I found that the problem is in the JOIN.
s> It seems that the FIRST, SKIP is applied before the JOIN is executed.
s> The second table (msg_to) has more than one record with the same
s> common_id. FB actually applies the FIRST and the SKIP to the records
s> from the msg_to & messages tables, rather than to the JOINed result
s> set. Then the JOIN is applied and the returned results are
s> from 'messages' after what remained from msg_to.
s> Here is the SQL again, if someone has ideas:
Maybe you should try to create a view that joins your tables, and then
SELECT FIRST...SKIP... FROM ThatView ORDER BY...
Let us know if it works.
HTH
--
Best regards,
Pavel Menshchikov
http://www.ls-software.com
s> I found that the problem is in the JOIN.
s> It seems that the FIRST, SKIP is applied before the JOIN is executed.
s> The second table (msg_to) has more than one record with the same
s> common_id. FB actually applies the FIRST and the SKIP to the records
s> from the msg_to & messages tables, rather than to the JOINed result
s> set. Then the JOIN is applied and the returned results are
s> from 'messages' after what remained from msg_to.
s> Here is the SQL again, if someone has ideas:
Maybe you should try to create a view that joins your tables, and then
SELECT FIRST...SKIP... FROM ThatView ORDER BY...
Let us know if it works.
HTH
--
Best regards,
Pavel Menshchikov
http://www.ls-software.com