SELECT * FROM ( SELECT queue_name, jobs_pend, jobs_run FROM queues ORDER BY queue_name LIMIT 5 ) UNION ALL SELECT 'others', SUM(jobs_pend), SUM(jobs_run) FROM ( SELECT jobs_pend, jobs_run FROM queues ORDER BY queue_name LIMIT 18446744073709551615 OFFSET 5 )
Note: Tested only in SQLite, but it seems the LIMIT syntax is the same as in MySQL according to a cursory glance at the documentation. (Well, in fact, the large number has to be lower in SQLite, but MySQL documentation shows this constant).
($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
In reply to Re: How to add columns with new row name using perl from mysql query?
by choroba
in thread How to add columns with new row name using perl from mysql query?
by perlanswers
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |