sqlite - Join tables in android -


this question has answer here:

i have 3 tables in sqllite database 2 config tables , 1 main table data stored. how retrive data main table joining 2 tables in android, how , perform join operations.

can guide me.

you can execute rawquery.
example this:

db.rawquery("select a.*  table_1  inner join table_2 b on a.id=b.anyid  inner join table_3 c on b.id= c.anyid c.key = ?", new string[]{"test"}); 

the first parameter query want execute. keys want add query add ? in query.
second parameter string array. in array put keys, example given above value test.

edit:

it's possible use rawquery update, insert or delete.
example 1 simple update query:

db.rawquery("update table_1 set fielda = ?, fieldb = ? id = ?", new string[]{"test", "test2", "1"}); 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -