android - Join on two table with same primary key but different data -


i trying join 2 tables identical in structure. want join choose data second table if row same primary key exist in both. instance, if have following tables data -

enter image description here enter image description here

i want join give me -

enter image description here

any appreciated. thanks

something should work:

select table1._id, coalesce(table2.data, table1.data)      table1      left join table2 using _id; 

Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -