Originally posted by manjunathk
enititykey_1 and entitykey_2 are separate fields in a table. How does it matter if I reference the tablename as a.entitykey_1 and b.entitykey_2? Why should there be aliases if selfjoin is not there?
Manjunath look into the example below....u will i undersatnd why we should use ref table twice........
PHP Code:
A.Ent1 A.Ent2 B.entpkey C.entky D.entky
                
1    11    82    1    11
11    111    82    1    11
111    1111    82    111    1111
1111    11111    82    22    11111 
With ref table being used 2 times only row 1 and row 3 will be selected.

Had u used Ref table only once u wud have selected all the rows or no rows depending on A.ent1 and A.ent2 if they are same or different....it should be used in case if u want to roll ur rows into columns........



i hope this is clear.....

Abhay.