X
  • Search
  • Products
  • Services
  • Resources
  • About
  • Contact
  • Login

Copyright © 2025 MariaDB. All rights reserved.

The Ultimate Guide to High Availability with MariaDB
Download Now
  • Knowledge Base
  • Contact
  • Login
  • Search
  • Products
  • Solutions
  • Resources
  • Company
  • Pricing
  • Download
Knowledge Base » MariaDB Server Documentation » Using MariaDB Server » SQL Statements & Structure » Sequences » SEQUENCE Functions
  • Home
  • Open Questions
  • MariaDB Server
  • MariaDB MaxScale
  • MariaDB ColumnStore
  • Connectors
Ask a question here

SEQUENCE Functions

Functions that can be used on SEQUENCEs

  • LASTVAL

    Synonym for PREVIOUS VALUE for sequence_name.
  • NEXT VALUE for sequence_name

    Generate next value for a SEQUENCE. Same as NEXTVAL().
  • NEXTVAL

    Synonym for NEXT VALUE for sequence_name.
  • PREVIOUS VALUE FOR sequence_name

    Get last value generated from a SEQUENCE. Same as LASTVAL().
  • SETVAL

    Set the next value to be returned from a SEQUENCE.
  • ← DROP SEQUENCE
  • ↑ Sequences ↑
  • Information Schema SEQUENCES Table →
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.
  • ↑ Sequences ↑
  • Sequence Overview
  • CREATE SEQUENCE
  • SHOW CREATE SEQUENCE
  • ALTER SEQUENCE
  • DROP SEQUENCE
  • SEQUENCE Functions
  • Information Schema SEQUENCES Table
  • SHOW TABLES
  • Error 4084: Sequence has run out
  • Products
  • Solutions
  • Resources
  • Company
  • Pricing
  • Download MariaDB
Subscribe to our newsletter!
  • Legal
  • Privacy Policy
  • Cookie Policy

Copyright © 2025 MariaDB. All rights reserved.