문제

The following query doesn't result in the same answer on HSQLDB (2.3.1 with ORA syntax support set to true) as it does on Oracle.

select max(ID) from (select ID from TRANSACTION where LOAD=2 and ID>=4 order by ID asc) where rownum <=2

Applied to the following dataset

<dataset>
<TRANSACTION ID="2" LOAD="1" />
<TRANSACTION ID="3" LOAD="1" />
<TRANSACTION ID="4" LOAD="2" />
<TRANSACTION ID="5" LOAD="2" />
<TRANSACTION ID="6" LOAD="2" />
<TRANSACTION ID="7" LOAD="2" />
<TRANSACTION ID="8" LOAD="2" />
<TRANSACTION ID="10" LOAD="2" />
<TRANSACTION ID="11" LOAD="2" />
<TRANSACTION ID="12" LOAD="2" />
<TRANSACTION ID="13" LOAD="2" />
<TRANSACTION ID="14" LOAD="2" />
<TRANSACTION ID="15" LOAD="2" />
</dataset>

Oracle returns 5 but HSQLDB reports 15.

도움이 되었습니까?

해결책

Yes, there is a difference here which may be changed in a future version of HSQLDB.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top