我正在使用 mysql 5.5,我有 2 个表,如下
+--------+---------------+---------------+
| CALLID | DL_THROUGHPUT | UL_THROUGHPUT |
+--------+---------------+---------------+
| 115 | 33.3333 | 43.3333 |
| 116 | 70 | 80 |
+--------+---------------+---------------+
+--------+----------------+----------------+
| CALLID | DL_DATA_VOLUME | UL_DATA_VOLUME |
+--------+----------------+----------------+
| 117 | 45 | 35 |
+--------+----------------+----------------+
完全加入我得到这个:
+--------+---------------+---------------+--------+----------------+----------------+
| CALLID | DL_THROUGHPUT | UL_THROUGHPUT | CALLID | DL_DATA_VOLUME | UL_DATA_VOLUME |
+--------+---------------+---------------+--------+----------------+----------------+
| 115 | 33.3333 | 43.3333 | NULL | NULL | NULL |
| 116 | 70 | 80 | NULL | NULL | NULL |
| NULL | NULL | NULL | 117 | 45 | 35 |
+--------+---------------+---------------+--------+----------------+---------------+
我需要这个:
+--------+---------------+--------------+-----------------+----------------+
| CALLID | DL_THROUGHPUT | UL_THROUGHPUT | DL_DATA_VOLUME | UL_DATA_VOLUME |
+--------+---------------+---------------+-----------------+----------------+
| 115 | 33.3333 | 43.3333 | NULL | NULL |
| 116 | 70 | 80 | NULL | NULL |
| 117 | NULL | NULL | 45 | 35 |
+--------+---------------+---------------+-----------------+---------------+
有什么建议么?
非常感谢你,谢谢赞恩,对不起,但在我解释得不好之前,我也可以这样说:
+--------+---------------+---------------+
| CALLID | DL_THROUGHPUT | UL_THROUGHPUT |
+--------+---------------+---------------+
| 115 | 33.3333 | 43.3333 |
| 116 | 70 | 80 |
| 117 | 48 | 51 |
+--------+---------------+---------------+
+--------+----------------+----------------+
| CALLID | DL_DATA_VOLUME | UL_DATA_VOLUME |
+--------+----------------+----------------+
| 117 | 45 | 35 |
| 118 | 37 | 26 |
+--------+----------------+----------------+
我需要:
+--------+---------------+--------------+-----------------+----------------+
| CALLID | DL_THROUGHPUT | UL_THROUGHPUT | DL_DATA_VOLUME | UL_DATA_VOLUME |
+--------+---------------+---------------+-----------------+----------------+
| 115 | 33.3333 | 43.3333 | NULL | NULL |
| 116 | 70 | 80 | NULL | NULL |
| 117 | 48 | 51 | 45 | 35 |
| 118 | NULL | NULL | 37 | 26 |
+--------+---------------+---------------+-----------------+---------------+