No cache version.

Caching disabled. Default setting for this page:enabled (code DEF204)
If the display is too slow, you can disable the user mode to view the cached version.

Rechercher dans le manuel MySQL

13.2.12 TABLE Statement

TABLE is a DML statement introduced in MySQL 8.0.19 which returns rows and columns of the named table.

  1. TABLE table_name [ORDER BY column_name] [LIMIT number [OFFSET number]]

The TABLE statement in some ways acts like SELECT. Given the existance of a table named t, the following two statements produce identical output:

  1.  

You can order and limit the number of rows produced by TABLE using ORDER BY and LIMIT clauses, respectively. These function identically to the same clauses when used with SELECT (including an optional OFFSET clause with LIMIT), as you can see here:

  1. mysql> TABLE t;
  2. +----+----+
  3. | a | b |
  4. +----+----+
  5. | 1 | 2 |
  6. | 6 | 7 |
  7. | 9 | 5 |
  8. | 10 | -4 |
  9. | 11 | -1 |
  10. | 13 | 3 |
  11. | 14 | 6 |
  12. +----+----+
  13. 7 rows in set (0.00 sec)
  14.  
  15. mysql> TABLE t ORDER BY b;
  16. +----+----+
  17. | a | b |
  18. +----+----+
  19. | 10 | -4 |
  20. | 11 | -1 |
  21. | 1 | 2 |
  22. | 13 | 3 |
  23. | 9 | 5 |
  24. | 14 | 6 |
  25. | 6 | 7 |
  26. +----+----+
  27. 7 rows in set (0.00 sec)
  28.  
  29. mysql> TABLE t LIMIT 3;
  30. +---+---+
  31. | a | b |
  32. +---+---+
  33. | 1 | 2 |
  34. | 6 | 7 |
  35. | 9 | 5 |
  36. +---+---+
  37. 3 rows in set (0.00 sec)
  38.  
  39. mysql> TABLE t ORDER BY b LIMIT 3;
  40. +----+----+
  41. | a | b |
  42. +----+----+
  43. | 10 | -4 |
  44. | 11 | -1 |
  45. | 1 | 2 |
  46. +----+----+
  47. 3 rows in set (0.00 sec)
  48.  
  49. mysql> TABLE t ORDER BY b LIMIT 3 OFFSET 2;
  50. +----+----+
  51. | a | b |
  52. +----+----+
  53. | 1 | 2 |
  54. | 13 | 3 |
  55. | 9 | 5 |
  56. +----+----+
  57. 3 rows in set (0.00 sec)

TABLE differs from SELECT in two key respects:

  • TABLE always displays all columns of the table.

  • TABLE does not allow for any arbitrary filtering of rows; that is, TABLE does not support any WHERE clause.

For limiting which table columns are returned, filtering rows beyond what can be accomplished using ORDER BY and LIMIT, or both, use SELECT.

TABLE can be used with temporary tables.

TABLE can also be used in place of SELECT in a number of other constructs, including those listed here:


Find a PHP function
Error Infobrol

Can not display this page of the Infobrol website

Type of error (18-01)

Unknown format specifier "&"

Please try again in a few minutes…

Return to the home page




Steph