<p dir="auto"><strong>Migrated issue, originally created by Anonymous</strong></p>
<p dir="auto">Hi,<br>
I found that using limit/offset options with ORACLE DB produce wrong results output while selected column has duplicates. If I specify limit and offset the result query constructed by SQLAlchemy has the form (my table is Block and column path):</p>
<p dir="auto">select path from (select distinct path, row_number() over (order by path desc) as ora_rn from Block) where ora_rn&gt;1 and ora_rn&lt;5;</p>
<p dir="auto">Here I was looking for 3 non-duplicate rows, but the output had 3 rows with duplicates.</p>
<p dir="auto">The correct query should be constructed in a way:</p>
<p dir="auto">select path from (select distinct path from Block order by path desc) group by rownum,path having rownum&gt;1 and rownum&lt;5;</p>
<p dir="auto">which produce 3 non-duplicated rows. It works on Oracle 10.x, but I don't know if it will works on earlier version of Oracle DB.<br>
I think the problem with SQLAlchemy query is not having <em>having</em> and <em>group by</em> keywords.</p>
<p dir="auto">Valentin.</p>
<hr>
<p dir="auto">Attachments: <a href="../wiki/imported_issue_attachments/536/jimp_patch_1.bug536.diff">jimp_patch_1.bug536.diff</a></p>
<p dir="auto"><strong>Migrated issue, originally created by Eben Freeman (<a href="https://github.com/emfree">@emfree</a>)</strong></p>
<p dir="auto">Hi,<br>
Looks like <code class="notranslate">sqlalchemy.ext.declarative.__init__.py</code> no longer imports <code class="notranslate">as_declarative</code> in 0.9.9. Not a major problem for us, but seems likely to be a typo in the release, rather than an intentional change?</p>