You are here: Re: top 3 query, how? « PHP Language « IT news, forums, messages
Re: top 3 query, how?

Posted by Oli Filth on 06/27/05 14:34

Stefan Rybacki said the following on 27/06/2005 10:56:
> Jim S. wrote:
>
>> hi guys,
>> I have a table that am calculating number of clicks in it, how can i
>> make a
>> query that will give me the top 3 (or what ever number, 4, or 5 ...) my
>> brain at this moment 4:00 AM does not seem to want to help me out, so
>> please
>> help.
>> thanks
>> Jim
>
>
> Which RDBMS are you using?
>
> mySQL knows LIMIT
>
> SELECT clicks FROM clicktable ORDER BY clicks DESC LIMIT 1,3
>

That should be:

LIMIT 0, 3

or:

LIMIT 3

Row-numbering starts from 0.


--
Oli

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация