Select A.user_id,ifnull (SUM (ifnull (a.ex_cpu,0)), 0) as A0, ifnull (Sum (ifnull (a.ex_mem,0)), 0) as A1, Ifnull (Sum (ifnull ( a.ex_disk,0)), 0) as A2, Ifnull (SUM (ifnull (b.cpu,0)), 0) as A3, Ifnull (SUM (ifnull (b.mem,0)), 0) as A4, ifnull (SUM (ifnull ( b.disk,0)), 0) as A5 from Tbl_service_instance as A left joins Tbl_service_spec as B on a.service_spec_id = b.id where a.env _id = "84d97900-8d24-4904-984e-e49d6809e3af" and a.project_id = "6fe742d2-c872-4292-bb03-bf1af481cb4d" and A.status! = 2 and a.status! = 3 Group by a.user_id;
Select a.user_id, Ifnull (SUM (ifnull (a.ex_cpu,0)), 0) +ifnull (sum (ifnull (b.cpu,0)), 0) as AAA, Ifnull (SUM (ifnull (a.ex_ mem,0)), 0) +ifnull (sum (ifnull (b.mem,0)), 0) as BBB, Ifnull (SUM (ifnull (a.ex_disk,0)), 0) +ifnull (sum (ifnull (b.disk,0)) , 0) as total from Tbl_service_instance as A left join Tbl_service_spec as B on a.service_spec_id = b.id where a.env_id = " 84d97900-8d24-4904-984e-e49d6809e3af "and a.project_id =" 6fe742d2-c872-4292-bb03-bf1af481cb4d "and A.status! = 2 and A.status! = 3 GROUP BY user_id ORDER by Total DESC LIMIT 5;
Cd/opt/java/workspace/xproject && echo-e "\033[32mwarmly Welcome, My honored Master, I ll take the full orders of yo u! \033[0m "
"MySQL" MySQL statistics null field processing