i'm using a sqlite database and have to query similar fields spread across 3-5 tables, so in other words, the schema of the tables are the same.
now, what you guys think is faster, more performant?
SELECT ... FROM table1 WHERE ...
UNION ALL
SELECT ... FROM table2 WHERE ...
...
ORDER BY ...;
or
SELECT ... FROM
(SELECT * FROM table1 UNION ALL SELECT * FROM table2 ...)
WHERE ...
ORDER BY ...;
thanks
now, what you guys think is faster, more performant?
SELECT ... FROM table1 WHERE ...
UNION ALL
SELECT ... FROM table2 WHERE ...
...
ORDER BY ...;
or
SELECT ... FROM
(SELECT * FROM table1 UNION ALL SELECT * FROM table2 ...)
WHERE ...
ORDER BY ...;
thanks