Re: LIMIT?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Chris wrote:
Hi,

Just because it supports the keyword 'limit' doesn't mean much.

mysql does:
select * from table limit x,y;

postgresql does:
select * from table limit y offset x;

different syntax.

Because it makes the thread harder to read.

Why is top posting bad?

Anywho, A) I said that "Considering that the OP mentioned using the LIMIT command in his original post, it's probably safe to say that his db supports it." Which means quite a bit; his db supports it. B) Let's once again look at the OP's post, follow the thread, and use our problem solving skills: "SELECT * FROM `x_news` LIMIT 0 , 15". Hmmm, can we tell what syntax that follows?

John Nichel wrote:
James Kaufman wrote:

On Mon, Feb 06, 2006 at 05:08:59PM +0200, Andrei wrote:

You can use SELECT fields FROM table WHERE condition LIMIT 15, -1 and it will select all from 15...

    Andy

William Stokes wrote:

Hello

I have a news page which is getting quite long now and I would like to split the news to two pages. Now I have one SQL query for all the rows and I think I could use LIMIT to limit the results but how to limit the results for example to 15 rows for page one and from 16 to the last on second page? Number of rows increase daily.

One page one there's headline and short summary and the second page should be "archive" with only the headline so all remaining rows can be printed to one page.

Something like: "SELECT * FROM `x_news` LIMIT 0 , 15" but how to do the archive page SELECT * FROM `x_news` LIMIT 16 , xx?

Thanks
-Will




Answers that show SQL commands that apply to specific databases annoy
me. Not everyone uses MySQL. I've worked with several databases that
don't support a LIMIT command. At least mention the database engine
you are referencing.


Considering that the OP mentioned using the LIMIT command in his original post, it's probably safe to say that his db supports it. At least follow the thread.




--
By-Tor.com
...it's all about the Rush
http://www.by-tor.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux