Hello All,
This is not going to be easy and I tried working on this for some time now, what I want is to create a master query where I select data from 4 different tables use the 4 values in a calculation and insert it into a other table.
If you have any clue on how to create such a query please let me know..
And if this make no sense please let me know that to..
Best regards
Wizzuriz
How to create One Master Query
Re: How to create One Master Query
What is the calculation ? Also, what are the tables like, are they linked in some way ?
Re: How to create One Master Query
1. The calculation is $variable = $row['value1'] * pow(1 - $row['value2'], $step1) * $row["value3"] * $row['value4'] * $row["value5"];
2. The tables, I have 5 different tables holding 160 rows with 15 columns = 2400 different values in each table. I need to select a specific value from each table and use them in the calculation..
3. they are not linked in any way, I don't know but there might be a way to do that if that will help I cloud take a look at it..
Best regards
Wizzuriz
2. The tables, I have 5 different tables holding 160 rows with 15 columns = 2400 different values in each table. I need to select a specific value from each table and use them in the calculation..
3. they are not linked in any way, I don't know but there might be a way to do that if that will help I cloud take a look at it..
Best regards
Wizzuriz
Re: How to create One Master Query
Well, you probably need to do it with 6 queries if there is no link at all. 5 for selecting from each table and one for inserting into the new one.
I would not like to do any single function that involved more than two really, so maybe a re-think is needed on your database structure.
I would not like to do any single function that involved more than two really, so maybe a re-think is needed on your database structure.
Re: How to create One Master Query
Hi Jacek,
Yea its was a big problem, there was way to much code in that function in the end.
I did 4 function with 2 query in each and then got them in the calculating function, its works fine.
Now I need to learn how to select 90 rows in a table and put them all in a array and move that array to a other function any idea?
Any way thanks for the help with the master query its working fine now with 4 small helping it
Best regards
Wizzuriz.
Yea its was a big problem, there was way to much code in that function in the end.
I did 4 function with 2 query in each and then got them in the calculating function, its works fine.
Now I need to learn how to select 90 rows in a table and put them all in a array and move that array to a other function any idea?
Any way thanks for the help with the master query its working fine now with 4 small helping it
Best regards
Wizzuriz.
Re: How to create One Master Query
Well you can limit the number of rows you select using LIMIT
You put them into an array as normal, and you could then have the function return that array ?
SELECT `id` FROM `table` LIMIT 0, 90would take the first 90.
You put them into an array as normal, and you could then have the function return that array ?