Re: MsSQL LIMIT limit

From: Date: Fri, 22 Dec 2000 12:39:45 +0000
Subject: Re: MsSQL LIMIT limit
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-5406@lists.php.net to get a copy of this message
I have built a backend system with MySQL and ODBC/MySQL and , in viewing search results, for buttons like Back and Next I used MySQL specific LIMIT. Thing is I have to port the system on MsSQL. Now I have to rewrite some code and I suppose I could do 2 things. 1. Rewrite entire code before calling database object's ExecuteQuery method and not base on LIMIT anymore. (sometimes it was really necessary, sometimes only for speed reasons) 2. Rewrite the ExecuteQuery method of database object the way that when he sees LIMIT manually generates desired output. What would be the option you would follow if you were me? Do you have other solutions?
Sir, what you do depends very much on what the system is being ported to. From your description, it isn't clear what is being ported or what it is being ported to. It sounds your MySQL back end is being ported to Access. If that is the case, use the TOP predicate in place of the LIMIT keyword. SELECT TOP 10 gives you the first 10 rows in the result table. SELECT TOP 10 PERCENT gives you the first 5 rows, if there are 50 in the result table. Bob Hall Know thyself? Absurd direction!
Bubbles bear no introspection.     -Khushhal Khan Khatak


« previous php.db (#5406) next »