That returns 1 record (and same if I correct @rownum to @row_num)
queue_name jobs_pend jobs_run others 471 457
If I run the sub-select without the CASE like this
SELECT @row_num, queue_name, jobs_pend, jobs_run FROM ( SELECT @row_num := @row_num + 1, queue_name, jobs_pend, jobs_run FROM queues, (SELECT @row_num := 0) r ) q
it returns
@row_num queue_name jobs_pend jobs_run 20 adice_long 5 39 20 adice_ncsim 0 6 20 adice_short 254 192 20 calibre 0 0 20 dsp_ncsim_gls 0 2 20 dsp_ncsim_hp 0 2 20 dsp_ncsim_lp 0 5 20 dsp_ncsim_mp 0 5 20 hcg_ncsim_comp 0 0 20 hcg_ncsim_hp 0 9 20 hcg_ncsim_lp 0 0 20 hcg_ncsim_mp 0 0 20 hcg_ncsim_short 0 0 20 ipdc_pte 0 0 20 ncsim_long 41 78 20 ncsim_lp 1 4 20 ncsim_short 0 84 20 normal 170 30 20 spectreRF 0 1 20 vcs 0 0poj
In reply to Re^7: How to add columns with new row name using perl from mysql query?
by poj
in thread How to add columns with new row name using perl from mysql query?
by perlanswers
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |