Get corrosponding record Of Row in Another Column of SQL Table

前端 未结 3 1435
傲寒
傲寒 2021-01-29 06:20

I am having SQL table where the records of the employee on daily basis are stored/saved I would like to get that result in tabular format

Consider a Table As Shown Below

3条回答
  •  终归单人心
    2021-01-29 06:58

    Consider the following, which uses application code to handle the pivoting/rearrangement of an array...

    
    

    Outputs:

    Array
    (
        [Catherine] => Array
            (
                [in] => 2019-07-07 10:10:00
                [lunch] => 2019-07-07 14:30:00
                [out] => 2019-07-07 18:30:00
            )
    
        [John] => Array
            (
                [in] => 2019-07-07 10:00:00
                [lunch] => 2019-07-07 13:00:00
                [out] => 2019-07-07 18:00:00
            )
    
        [William] => Array
            (
                [in] => 2019-07-07 19:14:00
            )
    
    )
    

提交回复
热议问题