Q:

MySQL count by months, years or display 0 if none

I have two tables below. I fetch all different months and years from table job_statuses and group them (Done in part 1 of query). Then I would like to go through those results and count all rows in second table ticket_jobs if they are in current month&year interval, also for row to be counted, it must contain string "claim" inside extra_info field. The question is that I also want results that have no rows done in current time frame. I read that solution to achieve that is to use left join with same table, but I'm not sure if I used it correctly, because they currently still don't show in results.
Query theory: get all different months & years from job_statuses, cycle through them and count rows in ticket_jobs which are in current timeframe of month & years  and have "claim" in extra_info. Display 0 if none in current timeframe.
Table: job_statuses (data which resources were used and when):
id (int, primary ID)
input
created_at (timestamp ex: 2018-06-05 08:00:00)
finished_at (timestamp ex: 2018-06-06 08:00:00)

Table: ticket_jobs (data about all tickets and which were already claimed)
id (int, primary ID)
extra_info (text ex: "claimed:3256262")
created_at (timestamp ex: 2018-06-05 08:00:00)
finished_at (timestamp ex: 2018-06-06 08:00:00)

Current result:
+------+-------+---------+
| year | month | claimed |
+------+-------+---------+
| 2018 | 6     | 120     |
+------+-------+---------+
| 2018 | 7     | 40      |
+------+-------+---------+
| 2018 | 8     | 125     |
+------+-------+---------+
| 2018 | 11    | 46      |
+------+-------+---------+
| 2018 | 12    | 24      |
+------+-------+---------+
| 2019 | 3     | 29      |
+------+-------+---------+

Would like to achieve
+------+-------+---------+
| year | month | claimed |
+------+-------+---------+
| 2018 | 6     | 120     |
+------+-------+---------+
| 2018 | 7     | 40      |
+------+-------+---------+
| 2018 | 8     | 125     |
+------+-------+---------+
| 2018 | 9     | 0       |
+------+-------+---------+
| 2018 | 10    | 0       |
+------+-------+---------+
| 2018 | 11    | 46      |
+------+-------+---------+
| 2018 | 12    | 24      |
+------+-------+---------+
| 2019 | 1     | 0       |
+------+-------+---------+

Current query
SELECT year, month, claimed
    FROM 
    (
        //  Get all months & years from job_statuses table

        (SELECT YEAR(created_at) AS year, MONTH(created_at) AS month FROM job_statuses 
         GROUP BY YEAR(created_at), MONTH(created_at)) x, 

        //  Count rows in ticket_jobs table for each year&month result from above that contains "like", 
        //  or put 0 if count returns empty rows

        (SELECT YEAR(t.created_at) y, MONTH(t.created_at) m, COUNT(*) AS claimed 
        FROM ticket_jobs t
        LEFT JOIN ticket_jobs lj ON t.created_at = lj.created_at AND 
        lj.extra_info LIKE "%claim%" 
        GROUP BY YEAR(t.created_at), MONTH(t.created_at)) b
    )

WHERE year=b.y AND month=b.m 
GROUP BY year, month
ORDER BY year ASC, month ASC

Example
After execution of first part we get this example data from job_statuses table
+------+-------+
| year | month |
+------+-------+
| 2018 | 7     |
+------+-------+
| 2018 | 8     |
+------+-------+
| 2018 | 9     |
+------+-------+

We have sample data in our ticket_jobs table
+----+----------------+---------------------+---------------------+
| id | extra_info     | created_at          | finished_at         |
+----+----------------+---------------------+---------------------+
| 1  | {"claimed":125} | 2018-07-05 06:33:50 | 2018-07-05 06:42:50 |
+----+----------------+---------------------+---------------------+
| 2  | {"claimed":86}  | 2018-08-15 06:33:50 | 2018-08-22 06:33:50 |
+----+----------------+---------------------+---------------------+
| 3  |                | 2018-09-01 06:33:50 | 2018-09-03 06:33:50 |
+----+----------------+---------------------+---------------------+

So the result would be
+------+-------+---------+
| year | month | claimed |
+------+-------+---------+
| 2018 | 7     | 1       |
+------+-------+---------+
| 2018 | 8     | 1       |
+------+-------+---------+
| 2018 | 9     | 0       |
+------+-------+---------+

A:

Change the below part as
SELECT YEAR(t.created_at) y, MONTH(t.created_at) m, COUNT(extra_info) AS claimed 
FROM ticket_jobs t
LEFT OUTER JOIN ticket_jobs lj ON t.created_at = lj.created_at AND  lj.extra_info LIKE "%claim%" 
GROUP BY YEAR(t.created_at), MONTH(t.created_at)

Or
SELECT y,m,IFNULL(b.claimed,0) claimed FROM
(
    SELECT YEAR(t.created_at) y, MONTH(t.created_at) m, COUNT(*) AS claimed 
    FROM ticket_jobs t
    LEFT OUTER JOIN ticket_jobs lj ON t.created_at = lj.created_at AND lj.extra_info LIKE "%claim%" 
    GROUP BY YEAR(t.created_at), MONTH(t.created_at)
) b

