Hi,
i have a Mysql query which returns me a set of records say 1 to 10 using limit.
But the same query doesn't work with Oracle. In oracle limit function is not there instead i can use rownum, but rownum is not supported by MySql .
I am looking for a common query which works with both MySql as well as with Oracle. Is there any way to do so ?
Limit in Oracle
Started by Apaul, May 17 2009 10:39 PM
2 replies to this topic
#1
Posted 17 May 2009 - 10:39 PM
|
|
|
#2
Posted 18 May 2009 - 02:59 AM
Unfortunately, no.
One of the frustrations I'm dealing with in one program I have is that Oracle, Firebird, and SQL Server use three completely different limit function syntaxes. To make matters worse, there isn't a good way on SQL Server to get records 101-200! There's a hack, but it doesn't work very well. Oracle is a little bit hackish as well.
One of the frustrations I'm dealing with in one program I have is that Oracle, Firebird, and SQL Server use three completely different limit function syntaxes. To make matters worse, there isn't a good way on SQL Server to get records 101-200! There's a hack, but it doesn't work very well. Oracle is a little bit hackish as well.
#3
Guest_Jordan_*
Posted 18 May 2009 - 01:37 PM
Guest_Jordan_*
I've ran into that problem before. Here is how to do it in MySQL, Oracle and MsSQL:
// mysql select col from table limit 10; // Oracle select col from table where rownum<=10; // Microsoft SQL select top 10 col from table;


Sign In
Create Account

Back to top









