How to do INNER JOIN between tables in SQLite android? [duplicate]

0

I would like to know how to make a more elaborate query using INNER JOIN to join two tables in SQLite for android. I know how to do queries using INNER JOIN in MySQL. What I want to know is how to do them in an android application, if it is the same way and if there is no problem.

    
asked by anonymous 20.04.2017 / 20:16

2 answers

0
SELECT t1.columns, t2.columns //campos que você quer visualizar
FROM table1 t1
INNER JOIN table2 t2 on (t1.column = t2.column) //você deve comparar com as chaves das tabelas

I'm happy to help.

Reference

    
20.04.2017 / 21:05
-1

If you use the query () method, which only accepts a single table as an input parameter, you can create a view containing this join and pass it to the method.

If you use the rawQuery () method, you can create the JOIN normally in the SQL string.

    
08.05.2017 / 19:18