SQLite last_insert_rowid() function
Description
The last_insert_rowid() function returns the ROWID of the last row insert from the database connection which invoked the function.
Note: The last_insert_rowid() SQL function is a wrapper around the sqlite3_last_insert_rowid() C/C++ interface function.
Syntax:
last_insert_rowid()
Example: SQLite last_insert_rowid() function
sqlite> DELETE from table1; sqlite> SELECT * FROM table1; sqlite> INSERT INTO table1 VALUES(1, 'AAA');
SELECT last_insert_rowid();
Sample Output:
last_insert_rowid() ------------------- 1
sqlite> INSERT INTO table1 VALUES(2, 'BBB');
sqlite> SELECT last_insert_rowid();
Sample Output:
last_insert_rowid() ------------------- 2
- New Content published on w3resource:
- HTML-CSS Practical: Exercises, Practice, Solution
- Java Regular Expression: Exercises, Practice, Solution
- Scala Programming Exercises, Practice, Solution
- Python Itertools exercises
- Python Numpy exercises
- Python GeoPy Package exercises
- Python Pandas exercises
- Python nltk exercises
- Python BeautifulSoup exercises
- Form Template
- Composer - PHP Package Manager
- PHPUnit - PHP Testing
- Laravel - PHP Framework
- Angular - JavaScript Framework
- Vue - JavaScript Framework
- Jest - JavaScript Testing Framework