How do I join these two tables, showing results from the second table? I have two tables and I want the following result: if CID and CID2 are equal, print cpu about value of CID2.

Table A:

+------+---------------------+--------------------+-----------------+
| CID  | time                | step               | time_in_seconde |
+------+---------------------+--------------------+-----------------+
|    1 | 2017-07-27 06:26:50 | gege               |          10.229 |
|    2 | 2017-07-27 06:26:58 | rere               |          10.239 |
|    3 | 2017-07-27 06:35:52 | gege               |          13.229 |
|    4 | 2017-07-27 06:36:56 | titi               |          12.823 |
|    5 | 2017-07-27 06:55:04 | fefe               |          12.667 |


Table B:

+------+---------------------+-----------------+
| CID2 | time                | cpu             |
+------+---------------------+-----------------+
|    3 | 2017-07-27 06:35:52 |          0.01   |
|    4 | 2017-07-27 06:36:56 |          0.05   |
|    5 | 2017-07-27 06:55:04 |          0.03   |


Result:

+------+---------------------+-----------------+
| CID2 | time                | cpu             |
+------+---------------------+-----------------+
|    1 | 2017-07-27 06:26:50 |                 |
|    2 | 2017-07-27 06:26:58 |                 |
|    3 | 2017-07-27 06:35:52 |          0.01   |
|    4 | 2017-07-27 06:36:56 |          0.05   |
|    5 | 2017-07-27 06:55:04 |          0.03   |


This query is what I've tried, but it doesn't work:

select A.cid, A.time, C.cpu 
  from A 
 INNER JOIN B on A.cid = B.CID2 
 where A.time ="2018-12-17 14:00:00";


I'm using mariadb.

Do you have any ideas?

I have also tried a query from @MikNiller, I don't want this, I want the same as below: 

+------+---------------------+-----------------+
| CID2 | time                | cpu             |
+------+---------------------+-----------------+
|    1 | 2017-07-27 06:26:50 |       0.01      |
|    2 | 2017-07-27 06:26:58 |       0.05      |
|    3 | 2017-07-27 06:35:52 |       0.03      |
|    4 | 2017-07-27 06:36:56 |                 |
|    5 | 2017-07-27 06:55:04 |                 |
select A.cid, A.time, IF(A.cid = B.CID2,C.cpu,NULL) 
 from A 
 LEFT JOIN B on A.cid = B.CID2 
 where A.time ="2018-12-17 14:00:00";