Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You would have to define a user-defined aggregate to do this. That has four parts - four functions (search for <a href="https://www.ibm.com/support/knowledgecenter/SSGU8G_12.1.0/com.ibm.sqls.doc/ids_sqs_0358.htm" rel="nofollow noreferrer">CREATE AGGREGATE</a> in the <a href="http://www-01.ibm.com/support/knowledgecenter/SSGU8G_12.1.0/com.ibm.welcome.doc/welcome.htm" rel="nofollow noreferrer">IDS 12.10 Info Centre</a>):</p> <ol> <li>Initializer (INIT)</li> <li>Iterator (ITER)</li> <li>Combine (COMBINE)</li> <li>Finalizer (FINAL)</li> </ol> <p>That's the official terminology in capitals, and it is moderately intuitive. Think of calculating an average.</p> <ol> <li>Initializer: set sum = 0; N = 0</li> <li>Iterator: set sum += x; N++</li> <li>Combiner: set sum = sum1 + sum2; set N = N1 + N2</li> <li>Finalizer: result = sum / N -- with N=0 (zero-divide) checks</li> </ol> <p>The combiner is used to combine intermediate results from parallel execution; each parallel execution starts with the iterator and generates intermediate results. When the parallel execution completes, the separate sets of values are combined with the combiner.</p> <p>You can write analogous code in IDS - using stored procedures or C or Java UDRs.</p> <p>See the SO question <a href="https://stackoverflow.com/questions/715350/show-a-one-to-many-relationship-as-2-columns-1-unique-row-id-comma-separated">Show a one to many relationship as 2 columns — 1 unique row (ID &amp; comma separated list)</a> for a string-based GROUP_CONCAT() function implemented in Informix.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload