I have three tables, I want to count the tbl_repository with how many rows are stored there. tbl_downloadcount
and tbl_recentlyview
I want to sum all the numeric values in the cilumn which is download_count
and number_views
.
SELECT SUM(tbl_downloadcount.download_count) AS dlcount, SUM(tbl_recentlyview.number_views) AS numviews, COUNT(DISTINCT tbl_repository.document_added) AS publish FROM tbl_downloadcount, tbl_recentlyview, tbl_repository
my download_count SHOULD have a total of 6 (4+1+1) the number_views SHOULD have a total of 7 (3+2+2) ...
Whenever I run the query it result me a dlcount = 54 / numviews = 63 / publish = 3 and publish is the only the right result(which is 3)