In Android SQLite db how to match particular columns values which have same id's in multiple tables of a database? -


i had dumped data sqlite json data getting. question have single database multiple tables want relate multiple tables using there id's.these 3 tables had created.

this first table have product list,

private static final string database_create_product =             "create table if not exists " + "product_template" + " (" +                     "_id" + " integer primary key autoincrement," +                     "name" + "," +                     "list_price" + "," +                     "create_date" + "," +                     "default_code" + "," +                     "ean13" + "," +                     "image_new" + "," +                     "image_variant" +                     ");"; 

this second table have partner list,

    private static final string database_create_partner =             "create table if not exists " + "res_partner" + " (" +                     "_id" + " integer primary key autoincrement," +                     "phone" + "," +                     "mobile" + "," +                     "name" +                     ");"; 

this third table have account line,

    private static final string database_create_line =             "create table if not exists " + "account_invoice_line" + " (" +                     "product_id" + "," +                     "partner_id" +                     ");"; 

in third table have 2 columns product_id , partner_id, should match values of partner_id second table column _id , should values of name column in , through values in column partner_id should match first table _id , should values in name column.

can 1 in creating relation between tables?

try this:

select t1.name prod_name, t2.name part_name product_template t1, res_partner t2, account_invoice_line t3 t3.product_id = t1.id , t3.partner_id = t2.id 

Comments

Popular posts from this blog

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -