Is there any built in function available in SQLite to fetch last inserted row id. For eg :- In mysql we have LAST_INSERT_ID() this kind of a function. For sqllite any function available for doing the same process.

SQLite中是否有内建函数可以获取最后插入的行id ?对于sqllite,可以使用任何函数来执行相同的过程。

Please help me.

请帮助我。

Thanks

谢谢

5 个解决方案

#1


19

SQLite

This is available using the SQLite last_insert_rowid() function:

这可以使用SQLite last_insert_rowid()函数获得:

The last_insert_rowid() function returns the ROWID of the last row insert from the database connection which invoked the function. The last_insert_rowid() SQL function is a wrapper around the sqlite3_last_insert_rowid() C/C++ interface function.

函数的作用是:从调用函数的数据库连接返回最后一行插入的ROWID。last_insert_rowid() SQL函数是围绕sqlite3_last_insert_rowid() C/ c++接口函数的包装器。

PHP

The PHP version/binding of this function is sqlite_last_insert_rowid():

这个函数的PHP版本/绑定是sqlite_last_insert_rowid():

Returns the rowid of the row that was most recently inserted into the database dbhandle, if it was created as an auto-increment field.

返回最近插入到数据库dbhandle中的行的rowid,如果它是作为自动增量字段创建的。

更多相关文章

  1. MYSQL存储过程,函数,光标
  2. 请问mysql中有没有类似math.max(1,2)这种可以比较两个值中最大值
  3. SQL 函数如何设置参数默认值
  4. 使用不同的条件,在同一个表的一个SQL查询中使用多个聚合函数
  5. PHP OOP - 调用非obj上的成员函数[重复]
  6. sqlserver的常用函数
  7. SQLSERVER2005调试存储过程跟函数
  8. SQL Server中的TextPtr函数
  9. MySQL字符串相加函数如何运行?似曾相识还是记一笔吧

随机推荐

  1. Android(安卓)Context 是什么?
  2. Android 学习 -- android 发展史及由来
  3. android Progress style (长进度条)
  4. Android Wear(手表)开发 - 学习指南
  5. 预测今年将是android应用普及年和android
  6. android app 设计总结
  7. Android进程,任务,服务的信息
  8. 刚刚接触Android,写第一个Hello world 小
  9. Android 背景色平铺。
  10. android 环境的搭建