I have 3 tables. And I use math operations for this three tables.
SELECT table_1.a + table_2.a + table_3.a
FROM table_1
LEFT JOIN table_2 ON table_2.user_id = table_1.user_id
LEFT JOIN table_3 ON table_3.user_id = table_1.user_id
WHERE table_1.user_id = ?
But every table from this query can be empty.
How I can fix to work correctly with empty tables?
Thanks.