I have these tables which are not related at all:
Books Apps Cars
Id Views Id Views Id Views
------------ ------------ ------------
1 3 4 5 11 10
2 4 5 100 13 3
3 3 6 5 15 7
I want:
total_books total_apps total_cars
10 110 20
Instead of 3 separate queries for the sum of views, I would like to have 1 query where I will get the sum of views in each table
SELECT SUM(books.views), SUM(apps.views), SUM(cars.views) FROM books,apps,cars;
giving me NULL NULL NULL