At 3:08 PM +0200 9/19/03, Daniele Tagliavini wrote:
Hi,

I have a question for the LIMIT clause.
I have two table with relation 1:n and a query like this :
SELECT tableA.id, tableB.name FROM tableA INNER JOIN tableB ON tableA.id=tableB.id WHERE something LIMIT x, 20


I want to restrict the result to 20 row from tableA and n row from tableB and not 20 row total.
It's possible to restrict the above query without have to select 20 id from tableA and query again the DB to retrieve other n records?

No. LIMIT is not handled that way. You could select with LIMIT from one table into a temporarary table, then join that with your second table and apply the second limit.


Daniel


--
Paul DuBois, Senior Technical Writer
Madison, Wisconsin, USA
MySQL AB, www.mysql.com

Are you MySQL certified? http://www.mysql.com/certification/


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to