-1
我有6列查詢,我也想得到其他表列的總和。如何從子查詢中獲取一行?
我希望子查詢的結果在一行中,但它重複。
select t.id, t.subject, t.created_at, u.name, l.name as l_name,
ty.name as t_name
,(select sum(new) from statuses) as new
,(select sum(open) from statuses) as open
,(select sum(close) from statuses) as close
,(select sum(`delete`) from statuses) as `delete`
from tickets t
left join users u on u.id=t.user_id
left join levels l on l.id=t.level_id
left join types ty on ty.id=t.type_id
你能幫我嗎?
所以應該是在所有其他行是什麼? – xQbert