crystalized
Programmer
I am wondering what the difference is if I use the join statement or leave the join statement out.
For example joining table1 and table2 on id1 and id2 can be done as:
Select table1.*,table2.*
from table1,table2
where table1.id1=table2.id2
This achieves the result set that I want, but I know that you can also use a join. Can anyone tell me what advantage I gain by using the join (especially for composite keys to be joined on).
I would also point out that I prefix all table field names with an identifier that lets me easily recognize the table (ie tblFirm has frID). This means that none of the joined fields have the same names. Would this mean that I still have to identify the joined fields in the join statement.
Does the join recognize the relationships that I have created and join on the fields identified in the relationship?
I know this is actually a series of questions but I am hoping to start improving my stored procedures. Thanks in advance for any insight that anyone can offer. [sig]<p>Crystal<br><a href=mailto:crystals@genesis.sk.ca>crystals@genesis.sk.ca</a><br><a href= > </a><br>--------------------------------------------------<br>
Experience is one thing you can't get for nothing.<br>
-Oscar Wilde<br>
[/sig]
For example joining table1 and table2 on id1 and id2 can be done as:
Select table1.*,table2.*
from table1,table2
where table1.id1=table2.id2
This achieves the result set that I want, but I know that you can also use a join. Can anyone tell me what advantage I gain by using the join (especially for composite keys to be joined on).
I would also point out that I prefix all table field names with an identifier that lets me easily recognize the table (ie tblFirm has frID). This means that none of the joined fields have the same names. Would this mean that I still have to identify the joined fields in the join statement.
Does the join recognize the relationships that I have created and join on the fields identified in the relationship?
I know this is actually a series of questions but I am hoping to start improving my stored procedures. Thanks in advance for any insight that anyone can offer. [sig]<p>Crystal<br><a href=mailto:crystals@genesis.sk.ca>crystals@genesis.sk.ca</a><br><a href= > </a><br>--------------------------------------------------<br>
Experience is one thing you can't get for nothing.<br>
-Oscar Wilde<br>
[/sig]