Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^12: How to add columns with new row name using perl from mysql query?

by finddata (Sexton)
on Apr 07, 2017 at 01:28 UTC ( #1187366=note: print w/replies, xml ) Need Help??


in reply to Re^11: How to add columns with new row name using perl from mysql query?
in thread How to add columns with new row name using perl from mysql query?

select queue_name,jobs_pending,jobs_running from((select queue_name,jo +bs_pending,jobs_running from queues order by queue_name limit 5)union + all(select 'others',sum(jobs_pending) int as jobs_pending,sum(jobs_r +unning) as jobs_running from (select jobs_pending,jobs_running from q +ueues order by queue_name limit 0 offset 5 ) foo)) foo;
The above thing now works for me.But the problem is others row not have the data type.So it prints NULL.How can i add data type along with 'others' row.
  • Comment on Re^12: How to add columns with new row name using perl from mysql query?
  • Download Code

Replies are listed 'Best First'.
Re^13: How to add columns with new row name using perl from mysql query?
by poj (Abbot) on Apr 07, 2017 at 02:46 UTC

    Read the docs here and search for the phrase

    To retrieve all rows from a certain offset up to the end of the result set

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1187366]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (9)
As of 2019-12-06 20:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (159 votes). Check out past polls.

    Notices?