Subject Re: Problem with FIRST x SKIP y
Author salisburyproject
Hi,

I found that the problem is in the JOIN.
It seems that the FIRST, SKIP is applied before the JOIN is executed.
The second table (msg_to) has more than one record with the same
common_id. FB actually applies the FIRST and the SKIP to the records
from the msg_to & messages tables, rather than to the JOINed result
set. Then the JOIN is applied and the returned results are
from 'messages' after what remained from msg_to.

Here is the SQL again, if someone has ideas:

select first 30 skip 100 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

I need to apply the FIRST, SKIP to the result set aftet the JOIN.
Any help will be highly appreciated!

BTW: Same results are returned by the ODBC driver and isql.

Thanks,
Kiril.


--- In firebird-support@yahoogroups.com, Milan Babuskov <milanb@k...>
wrote:
> salisburyproject wrote:
> > No result, same behavior.
> >>>The problem is still here - only 7 rows returned...
>
> I had the similar problem before. At the end it turned out that
table columns
> had some charset and I was connected with NONE, so some characters
could not
> transliterate. I also remember that there was no error, it just
didn't return
> all rows. Maybe this is your problem?
>
> BTW, which tool are you using? Do you get the same result when you
run query
> from isql?
>
> --
> Milan Babuskov
> http://fbexport.sourceforge.net
> http://www.flamerobin.org