用sqlite的感受:
sqlite和mysql很像,如果你对mysql有一定的经验,那么里面的sql写法也类似,比如常见的limit用法,mysql里面主要用limite分页,但是数据多了不建议,很影响效率。
sqlite常用用法函数总结如下:
query:
//need try catch and db.close();try{cursor = db.rawQuery("select * from "+MdmDbHelper.TABLE_NAME_AUTHORIZATION+" where apply_id=? and status=? order by id desc");if (cursor != null) { // 循环遍历cursor while (cursor.moveToNext()) { int id = cursor.getInt(cursor.getColumnIndex("id")); }} catch() {} finally {if (db != null) {db.close();}}
insert: