Hammons Randy G SSgt 612 ACOMS/SCXX wrote:
Unfortunately this goes well beyond the scope of my original question.In InnoDB tables, there is a syntax for defining "foreign keys" (look it up on mysql.com/doc), otherwise the JOIN examples you've been given is _how_. The definition isn't explicit (unless using foreign keys), its implicit in the use of the JOIN.
Although the inputs that you all have provided thus far have been a very
good read, I still don't grasp the concept of defining a relationship. Is
it simply referring to a primary key in a field other than the one where the
key was defined? Or is there some other way to define a key that I don't
see? All I'm looking for is a simple example, syntax excerpt, etc...that
shows me (only the "slow learner" level) exactly how to define a
relationship.
SELECT * FROM a
LEFT JOIN b ON b.primary_key = a.foreign_key_b
LEFT JOIN c ON c.primary_key = b.foreign_key_c
... the foreign_key_x values are simply values that match those available from the primary_keys they reference (hopefully all indexed).
--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php