Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

Fetch first n only returns one row

$
0
0
Hi everyone,

I am joining two tables, filtering on some columns, and then have an ORDER BY . Then I apply a "return first 10 rows only" .

The problem is, even though there are 36 rows that match the criteria, once I apply the "return first 10 rows only", only one row is returned.

If I remove the order by, the query behaves as expected, returning only 10 rows. If I order by the primary key instead of the original column, the query behaves as expected.

The explain plan shows "#Rows 1" where it normally would show the amount of first rows to be returned.

Any help or pointers to explain why the return set is incorrect when using first n rows would be greatly appreciated.

Thanks!

Viewing all articles
Browse latest Browse all 13329

Trending Articles