我试过这段代码
Cursor c=db.rawQuery("SELECT name FROM sqlite_master WHERE type = 'table'",null);
c.moveToFirst();
while(!c.isAfterLast()){
Toast.makeText(activityName.this, "Table Name=> "+c.getString(0), Toast.LENGTH_LONG).show();
}
Run Code Online (Sandbox Code Playgroud)
但它会引发错误 "android.database.sqlite.SQLiteException: no such table: sqlite_master(code 1):,while compiling: SELECT name FROM sqlite_master WHERE type='table'"
如何获取所有表名?帮我
提前致谢..
Map<String, String> map = new HashMap<String, String>();
map.put("first", "First Value");
map.put("second", "Second Value");
Run Code Online (Sandbox Code Playgroud)
我试过这个但是没用.有解决方案吗
JSONArray mJSONArray = new JSONArray(Arrays.asList(map));
Run Code Online (Sandbox Code Playgroud) 我有下面的查询,它正常工作,但不知道::在postgresql中的含义和用法.
select (
select (
case when 1 > 0 then 1::float / (
select count(id) from transactions_products where transaction_id in (
select id from transactions_transactions tt
where status = 3 and fi = 355
and (invoice_date >= 1420754400)
and (invoice_date <= 1421099999)
and (tt.division_id = 107)
and (tt.department_id = 210)
) and is_vehicle = 1
)::float else 0 end)
limit 1) as f_4
Run Code Online (Sandbox Code Playgroud)