Имя пользователя:
Пароль:  
Помощь | Регистрация | Забыли пароль?  

Название темы: Сайт на php + MySQL
Показать сообщение отдельно

Аватара для Prisoner

Engrossed by the Void


Сообщения: 2229
Благодарности: 60

Профиль | Отправить PM | Цитировать


Цитата:
SELECT [STRAIGHT_JOIN]
      [SQL_SMALL_RESULT] [SQL_BIG_RESULT] [SQL_BUFFER_RESULT]
      [SQL_CACHE | SQL_NO_CACHE] [SQL_CALC_FOUND_ROWS] [HIGH_PRIORITY]
      [DISTINCT | DISTINCTROW | ALL]
   select_expression,...
   [INTO {OUTFILE | DUMPFILE} 'file_name' export_options]
   [FROM table_references
     [WHERE where_definition]
     [GROUP BY {unsigned_integer | col_name | formula} [ASC | DESC], ...
     [HAVING where_definition]
     [ORDER BY {unsigned_integer | col_name | formula} [ASC | DESC] ,...]
     [LIMIT [offset,] rows]
     [PROCEDURE procedure_name]
     [FOR UPDATE | LOCK IN SHARE MODE]]
А вот по самой феньке LIMIT:
Цитата:
The LIMIT clause can be used to constrain the number of rows returned by the SELECT statement. LIMIT takes one or two numeric arguments. The arguments must be integer constants. If two arguments are given, the first specifies the offset of the first row to return, the second specifies the maximum number of rows to return. The offset of the initial row is 0 (not 1):
mysql> SELECT * FROM table LIMIT 5,10;  # Retrieve rows 6-15

To retrieve all rows from a certain offset upto the end of the result set, you can use -1 for the second parameter:
mysql> SELECT * FROM table LIMIT 95,-1; # Retrieve rows 96-last.

If one argument is given, it indicates the maximum number of rows to return:
mysql> SELECT * FROM table LIMIT 5;     # Retrieve first 5 rows
Надеюсь разберетесь.

-------
Не могу дать более дельный совет - не хватает системных ресурсов...


Отправлено: 03:11, 12-12-2003 | #6

Название темы: Сайт на php + MySQL