Reply to Re: I have a tricky MySQL Query

Your name:

Reply:


Posted by Gerry Vandermaesen on 04/11/06 13:44

endlesstide@gmail.com wrote:
> how would I
> query the database and request the first 50 records, sorted by
> ascending value?

I'd say a plain simple "SELECT * FROM table ORDER BY number LIMIT 50";

Have the "number field" indexed for optimization. MySQL also optimizes
the LIMIT clausule.

> - and also how would I query the database for a
> certain set of records by Unique ID such as 250 thru 300 --- and see
> those records in ascending order -relative- to the total record set?

Not sure of what you are asking here. This is how you select records
with id from 250 up to 300:

"SELECT * FROM table WHERE id >= 250 AND id <= 300";

Add " ORDER BY id" to order them on id or leave this way to get them in
the order they are stored in the database.

[Back to original 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

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