I'be been using SQL extensively in my applications for the last few years - in particular to filter a set of relational tables based on the value of a combo on a form leading to the result displaying in another combo on the same form. Sometimes there are 3 levels of filtration.
My SQL is really trial and error to get a result particularly with 3 or more tables. I now find that some work sometimes and not at others.
I have had a practice put to me that SQL is like an onion where joins mate the layers together.
When using say
are there any 'rules' for
- the order in which the joins are made
- which 'side' comes first in the ON statement.
Is there any other practical advice to make the job a bit more than hit or miss?
Many thanks
PW
My SQL is really trial and error to get a result particularly with 3 or more tables. I now find that some work sometimes and not at others.
I have had a practice put to me that SQL is like an onion where joins mate the layers together.
When using say
Code:
SELECT *;
FROM ;
(TEMP_GG AS G inner JOIN;
(TEMP_EE AS E inner join;
(TEMP_LL AS A inner JOIN;
TEMP_NN AS N ;
ON N.nper = A.Per_no;
AND N.primary;
);
ON E.eper = A.Per_no;
);
ON G.per1 = E.eper;
AND G.etype= 1926;
)
are there any 'rules' for
- the order in which the joins are made
- which 'side' comes first in the ON statement.
Is there any other practical advice to make the job a bit more than hit or miss?
Many thanks
PW