faqts : Computers : Databases : MySQL

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

58 of 99 people (59%) answered Yes
Recently 8 of 10 people (80%) answered Yes

Entry

How does table relationships work exactly? I need to use more than one table but they must be joined.

Feb 16th, 2008 02:45
dman, Wellin kerna, Andy Gray, chris bosman, http://sturly.com


To link 2 tables, they have to have a common field - a column where the 
entry in one table is the same as the entry in the other.  For example, 
table A has fields 1, 2 and 3 and table B has fields 1, 4 and 5.  To 
use both these tables, perform the select with the condition:
WHERE A.1 = B.1
meaning that field 1 in table A is the same as field 1 in table B