How to sort the jobs_pending and jobs_running separatelt using mysql?


my $stmt="select queue_name,jobs_pending,jobs_running from((select queue_name,jobs_pending,jobs_running from queues order by jobs_pending +jobs_running desc limit 5 )union all(select 'others' as queue_name ,sum(jobs_pending) as jobs_pending ,sum(jobs_running) as jobs_running from (select jobs_pending,jobs_running from queues order by jobs_running+jobs_pending desc limit 18446744073709551615 offset 5 ) foo)) foo;";

Here i had used jobs_pending and jobs_running together how i can separate it?


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.