I am trying to get the number of page opens on a per day basis using the following query.
SELECT day.days, COUNT(*) as opens
FROM day
LEFT OUTER JOIN track
The condition is in the WHERE
clause. After joining the tables the WHERE conditions are evaluated to filter out everything matching the criteria.Thus anything not matching tracking.open_id = 10
gets discarded.
If you want to apply this condition while joining the two tables, a better way is to use it with the ON
clause (i.e. joining condition) than the entire dataset condition.