I have 3 tables. Table 3 has two columns that are the primary keys of the other two tables (table 1 and table 2). So table 1 has an ID column with other columns and table 2 has an ID column with other columns and table 3 holds the ID's. I've tried this command and the syntax checker says it's correct however node.js breaks and doesn't give me an error code.
SELECT *
FROM table1
WHERE table1_ID IN (SELECT table2_WATCHID FROM table2)
UNION ALL
SELECT *
FROM table3 WHERE table3_ID = (SELECT table2_SETUPID FROM table2)
The node.js command I'm using is db.all()
Aucun commentaire:
Enregistrer un commentaire