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 0
poj
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|