【问题标题】:one to many relations data fetch from database mysqlone to many relations data fetch from database mysql
【发布时间】:2022-12-31 16:11:15
【问题描述】:

This is my clockin table:

This is my user table:

I want to accepted output in this type:

    标签: mysql


    【解决方案1】:

    Try with:

    SELECT 
        u.emid,
        u.name,
        c.date,
        GROUP_CONCAT(c.time) AS time
    FROM 
        user u 
        LEFT JOIN clockin c ON u.emid = c.emid
    GROUP BY
        u.emid, u.name, c.date
    
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-12-01
      • 1970-01-01
      • 1970-01-01
      • 2022-12-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多