My database has news articles and blog posts. The primary key for both is an ItemID that is unique across both tables.
The articles are in a table that has the following fields
- item_id
- title
- body
- date_posted
The blogposts table has the following fields
- item_id
- title
- body
- date_posted
both tables have extra fields unique to them.
I have a third table that holds meta information about articles and posts.
The items table has the following fields
- item_id
- source_id
- …
every blogpost and article has a record in the items table and a record in its respective table.
What I am trying to do is build a query that will count the number of items posted per day. I can do it for one table using a count grouped by date_posted but how to combine articles and posts count in one query?
Similar to Dems, but slightly simpler: