jeudi 2 juillet 2015

SQLite3 Insert Into table values from multiple selections

I want to do something such as

INSERT INTO TableC (field1, field2) VALUES (SELECT _id FROM TableA WHERE *some condition*, SELECT _id FROM TableB WHERE *some condition*);

Is this possible? What is it called? I can get it to work in a simpler case (selecting from one table), but I need the _id field to be auto generated:

INSERT INTO TableC (field1, field2) SELECT 232, _id FROM Categories WHERE *some condition*;

Links, suggestions, and keywords to search would be appreciated!

Aucun commentaire:

Enregistrer un commentaire