动态mysql数据透视表

时间:2019-04-22 02:54:38

标签: mysql sql database pivot

我有一个看起来像这样的表:

----------------------------------------------------
| rlcode       | rldate     | rltimein  | rltimeout |
-----------------------------------------------------
| 369.18.01633 | 2019-01-02 | 16:47:13  | 08:30:41  |          
| 369.18.01633 | 2019-01-03 | 08:31:49  | 17:03:59  |          
| 369.18.01633 | 2019-01-04 | 08:23:16  | 16:42:07  |  
-----------------------------------------------------

如何使用动态数据透视表创建这样的视图?

 -----------------------------------------------------------
| rlcode       | 2019-01-02     | 2019-01-03  | 2019-01-04 |
------------------------------------------------------------
| 369.18.01633 | Present        | Present     | Present    | 
-------------------------------------------------------------

0 个答案:

没有答案