in reply to How to add columns with new row name using perl from mysql query?
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,
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to add columns with new row name using perl from mysql query?
by perlanswers (Initiate) on Apr 03, 2017 at 08:46 UTC | |
by choroba (Cardinal) on Apr 03, 2017 at 11:16 UTC | |
by Anonymous Monk on Apr 03, 2017 at 11:30 UTC | |
by choroba (Cardinal) on Apr 03, 2017 at 12:21 UTC | |
by Anonymous Monk on Apr 03, 2017 at 17:37 UTC | |
|