我正在处理一个查询,我需要添加一个列,其任务名称包含一对多关系中存在的许多任务的数量 9 W& _" d0 {* }) F这是我的查询% {; ~+ W' `2 b: v& F8 X* M
SELECT e.full_name AS fullName, t.issue AS issue, CASE t.state WHEN 'open' THEN 'open WHEN 'pending' THEN 'In progress WHEN 'closed' THEN 'closed' END AS status, CASE t.scheduled WHEN TRUE THEN 'scheduled WHEN FALSE THEN 'non-scheduled' END AS scheduled, d.name AS device, DATE(t.date_created) AS dateCreated, DATE(t.last_updated) AS lastUpdateFROM tickets t INNER JOIN employees e ON t.employee_id = e.id INNER JOIN devices d ON d.id = t.device_idWHERE MONTHNAME(t.date_created) = 'August'ORDER BY dateCreated DESC这是我的工作计划http://sqlfiddle.com/#!9/39bf3e/1' L4 e( x% _0 R% M8 r' @
尝试添加 计数 和 分组依据, 但现在我在猜9 k& Z8 x& i5 T. h2 X
谢谢你的帮助 ]5 p5 ?' }7 i( { 3 d& @" m% k: Z& a解决方案: