Nested or chain queries for reports
Posted: Thu Jan 17, 2019 2:00 am
I want to do a complex query/report. I've read the nuBuilder will not do nested sql select queries. Can I do multiple temporary tables in order to get around that limitation? If so, how do I do this? I keep getting error messages, that the temporary tables do not exist. See process below. If I cannot use temp tables, is there some other solution? Here's the process I envision.
Step 1. Create a first temporary table using a select query from a single existing table based on several criteria in the report form. [Doing this separately speeds the next three steps.]
Step 2. Create a second temporary table using a select query from temporary table 1. [Using a a preg_replace function on one of the columns. The aim is to strip out all the lower case letters from the field.]
Step 3: Create a third temporary table using a select query from temporary table 2. [Concat 2 columns including the one created in step 2.]
Step 4: Create a fourth table (#TABLE_ID#) for the report using a query from temporary table 3. [GROUP_CONCAT on table 3]
Step 1. Create a first temporary table using a select query from a single existing table based on several criteria in the report form. [Doing this separately speeds the next three steps.]
Step 2. Create a second temporary table using a select query from temporary table 1. [Using a a preg_replace function on one of the columns. The aim is to strip out all the lower case letters from the field.]
Step 3: Create a third temporary table using a select query from temporary table 2. [Concat 2 columns including the one created in step 2.]
Step 4: Create a fourth table (#TABLE_ID#) for the report using a query from temporary table 3. [GROUP_CONCAT on table 3]