jeudi 1 janvier 2015

How do I select the results that were inserted?

I have two tables in a SQLite database.


First table:



id | name | number
1 | Paul | 1
2 | John | 2
3 | Jessica | 3


Second table:



id | name | number
1 | Aaron | 1
2 | Barbara | 2
3 | Erik | 3


I do a JOIN LEFT and I insert the result in the second table, so:


First table:



id | name | number
1 | Paul | 1
2 | John | 2
3 | Jessica | 3


Second table:



id | name | number
1 | Aaron | 1
2 | Barbara | 2
3 | Erik | 3
4 | Paul | 1
5 | John | 2
6 | Jessica | 3


After, in other sql statement, I select the results which were inserted in the second table ( 4 | Paul | 1; 5 | John | 2 and 6 | Jessica | 3).


Can i do this in one sql statement to get a better performance?


Thanks


Aucun commentaire:

Enregistrer un commentaire