Skip to content
Advertisement

MySQL Merge two queries based on mutual column

I have two queries that retrieve records from 2 different tables that are almost alike and I need to merge them together.

Both have created_date which is of type datetime and I’m casting this column to date because I want to group and order them by date only, I don’t need the time.


First query:


Second query:


What I need is to merge them like this:


Basically what I need is to have all dates together and for each date to have the corresponding values from those two queries.

Advertisement

Answer

try something like this.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement