我的查询给了我col_balance
的总和,但我想要一个特定的(缺少的单词)最后插入的COL_BALANCE值。它必须是这样的:
select COL_BALANCE from TABLE_NAME2 where name =(select col_bal from query where count is count -1 )
String selectQuery = " SELECT "+"sum(" + COL_BALANCE + ")"+ " FROM " + TABLE_NAME2 + " WHERE " + COL_CUST_NAME + "= '" + name + "';";
答案 0 :(得分:-1)
<强> SQLite的强>
可以使用SQLite last_insert_rowid()功能:
“last_insert_rowid()函数从调用该函数的数据库连接返回最后一行插入的ROWID.last_insert_rowid()SQL函数是sqlite3_last_insert_rowid()C / C ++接口函数的包装器。”