Combine Loop Query Results into 1
NickName:user2675939 Ask DateTime:2016-10-14T10:18:01

Combine Loop Query Results into 1

I have a loop that queries a SP and returns results in a query, I want to combine that query (however many times the loop runs) into one final query so I can output in my jgrid table. Here is the code:

  <cfloop query="query1">
      <cfstoredproc procedure="[Columns]" datasource="#CompanyDB#">
        <cfprocresult name="queryResults">
        <cfprocparam cfsqltype="cf_sql_varchar" value="#query1.ID#">
        <cfprocparam cfsqltype="cf_sql_varchar" value="#query1.Role#">
    </cfstoredproc>
  </cfloop>

So, here it loops 2 times hence I get 2 queryResults. I want to combine the results into 1 big query so I can then output in jGrid query.

Copyright Notice:Content Author:「user2675939」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/40033875/combine-loop-query-results-into-1

More about “Combine Loop Query Results into 1” related questions

Combine Loop Query Results into 1

I have a loop that queries a SP and returns results in a query, I want to combine that query (however many times the loop runs) into one final query so I can output in my jgrid table. Here is the c...

Show Detail

combine results from a loop in one file

I create a loop like this one: for (p in 1:nrow(outcomes)) { id &lt;- apply(regulationtable, 1, function(i) sum(i[1:length(regulationtable)] != outcomes[p,])==0) idd &lt;- as.ma...

Show Detail

combine results from loop in one file in R (some results were missing)

I want to combine the results from a for loop into 1 txt file and I have written my code based on suggestion from this link combine results from a loop in one file There is one problem. I am supp...

Show Detail

Laravel Query Multiple Models and Combine Results

In my app I return a view that contains all the records within the Posts model. I now have another model that I want to return the results of and in that same view I want to combine the query resul...

Show Detail

Combine mysql query with sub query results into one PHP array

I have a table that contains events, to list these events I loop through the event table, check the event type and look up it's value in it's specific table with it's eventId. At the moment this u...

Show Detail

Combine multiple SQL query results

I am working with PHP and I have made this code: ` $categories = array('casual','dinner', 'kids'); $numberOfCategories = count($categories); for ($i=0; $i &lt; $

Show Detail

Combine multiple results into 1

Suppose I have multiple queries: SELECT col1, col2 FROM tab1; SELECT colA, colB FROM tab2; SELECT colTest, colBlah FROM tab3; Every query would return only 1 result. How can I combine those 3 re...

Show Detail

How to combine Linq query results

I need to be able to add an unkown number of where clauses to a Linq query. Currently I have been trying to combine the queries using Concat(). For example: var r1 = from field in db.fields

Show Detail

Combine results of 2 SQL queries into 1

I have two sql queries as below 1. ;with test as (.........) select abc from (select ... from test) 2. ;with test1 as (....) select abc from (select ... from test1) Both of the queries ...

Show Detail

How to make mysql query from subqueries combine the 2 results in to 1 result

Questions: How to make this query results combine into 1 result? select *, count(winner) as count from (select case radiant_win when 1 then radiant_name ...

Show Detail