select_systemvariable_syntax.rst 950 B

1234567891011121314151617181920212223242526272829303132333435
  1. .. _select_systemvariable_syntax:
  2. SELECT @@system_variable syntax
  3. -------------------------------
  4. .. code-block:: mysql
  5. SELECT @@system_variable [LIMIT [offset,] row_count]
  6. This is currently a placeholder query that does nothing and reports
  7. success. That is in order to keep compatibility with frameworks and
  8. connectors that automatically execute this statement.
  9. However ``@@session.last_insert_id`` and ``LAST_INSERT_ID()`` report
  10. ``ID`` of documents these were inserted or replaced well at last statement.
  11. .. code-block:: mysql
  12. mysql> select @@session.last_insert_id;
  13. +--------------------------+
  14. | @@session.last_insert_id |
  15. +--------------------------+
  16. | 11,32 |
  17. +--------------------------+
  18. 1 rows in set
  19. mysql> select LAST_INSERT_ID();
  20. +------------------+
  21. | LAST_INSERT_ID() |
  22. +------------------+
  23. | 25,26,29 |
  24. +------------------+
  25. 1 rows in set