Help in formulating sql query
- by AJ
Here is my scenario
Table 1: GID || Info1
Table 2: GID || Tb1GID (refers
to GID of Table1) || Info2
Table 3: GID || Info3
Table 4: GID || Tb2GID (refers to
GID of Table2 || Tb3GID (refers to
Table3 GID || Value
Now I have to build an sql query to get the value, given a particular Info1, Info2, Info3.
Essentially, I have to get the GID, of table 1 using info1, GID of table to , by mapping info2 and GID of table 1. And then get the GID of table 3 using info 3. And combine these to GIDs to get the value in table 4.
What is the most optimal way of constructing an sql query for this one?