I am doing a formula to make some statistics in SQL, but I do not know how to improve a query I am working on…
I made a sqlfiddle so you can understand me better
So I have 3 tables and I need to solve a formula varying the indexes, i,j…
i j
---
1 1
1 2
1 3
2 1
2 2
2 3
3 1
3 2
3 3
and then do some sqrt and pow. I want the result in a table but I do not know how to generalize all those long queries into one…
This appears to just need a couple of
CROSS JOINs:(I’ve modified the Fiddle to include this. Thanks for providing one!).
However, your overall design is a little suspicious to me; what exactly are you attempting to accomplish?