How to get number of matching colums count in the same table as another column? I have a table like below.

    +----+----------+---------+--------+----------+---------+---------------------+
    | id | box_name | diIndex | diMode | diStatus | status  | last_updated        |
    +----+----------+---------+--------+----------+---------+---------------------+
    |  7 | boxa     |       0 |      0 |        0 |    1    | 2017-03-02 10:49:35 |
    |  8 | boxa     |       1 |      0 |        1 |    0    | 2017-03-02 10:49:35 |
    |  9 | boxa     |       2 |      0 |        0 |    1    | 2017-03-02 10:49:36 |
    | 10 | boxa     |       3 |      0 |        0 |    1    | 2017-03-02 10:49:36 |
    | 11 | boxa     |       4 |      0 |        0 |    0    | 2017-03-02 10:49:36 |
    | 12 | boxa     |       5 |      0 |        0 |    2    | 2017-03-02 10:49:36 |
    | 13 | boxa     |       6 |      0 |        0 |    2    | 2017-03-02 10:49:36 |
    | 14 | boxa     |       7 |      0 |        0 |    3    | 2017-03-02 10:49:36 |
    +----+----------+---------+--------+----------+---------+---------------------+


Now I want to add a new column in the table which will get me the total number of each matching record of status column like below.

+----+----------+---------+--------+----------+---------+---------------+---------------------+
| id | box_name | diIndex | diMode | diStatus | status  | status count  | last_updated        |
+----+----------+---------+--------+----------+---------+---------------+---------------------+
|  7 | boxa     |       0 |      0 |        0 |    1    |       3       | 2017-03-02 10:49:35 |
|  8 | boxa     |       1 |      0 |        1 |    0    |       2       | 2017-03-02 10:49:35 |
|  9 | boxa     |       2 |      0 |        0 |    1    |       3       | 2017-03-02 10:49:36 |
| 10 | boxa     |       3 |      0 |        0 |    1    |       3       | 2017-03-02 10:49:36 |
| 11 | boxa     |       4 |      0 |        0 |    0    |       2       | 2017-03-02 10:49:36 |
| 12 | boxa     |       5 |      0 |        0 |    2    |       2       | 2017-03-02 10:49:36 |
| 13 | boxa     |       6 |      0 |        0 |    2    |       2       | 2017-03-02 10:49:36 |
| 14 | boxa     |       7 |      0 |        0 |    3    |       1       | 2017-03-02 10:49:36 |
+----+----------+---------+--------+----------+---------++--------------+---------------------+


Here you can see that for status value 1 there are 3 records so value for status_count for columns having status as 1 will be 3 and so on..
How can I achieve this?
With window functions, this would be almost trivial to add as a column in a query:

COUNT(*) OVER (PARTITION BY status) AS status_count


Since MySQL hasn't implemented them (you'll have to wait, they may be in the next version), you'll need something more complex now. It can be done with a derived table - to calculate these counts - and then join to the base table:

SELECT 
    t.id, t.box_name, t.diIndex, t.diMode, t.diStatus, t.status,
    g.status_count, t.last_updated
FROM
    tableX AS t
  JOIN
    ( SELECT status, COUNT(*) AS status_count
      FROM tableX 
      GROUP BY status
    ) AS g
  ON
    t.status = g.status ;