You rock... While I had to message it a bit, to be like this:
mysql> SELECT rep_fname, rep_lname, dept_name, contact_fname, contact_lname
-> FROM company_table INNER JOIN dept_table ON company_id =
dept_company_table_id
-> LEFT JOIN contact_table ON dept_id = contact_dept_table_id
-> LEFT JOIN rep_table ON dept_rep_table_id = rep_id
-> WHERE company_id = '20'
-> ORDER BY dept_name;
+-----------+-----------+---------------------+---------------+-------------
--+
| rep_fname | rep_lname | dept_name | contact_fname |
contact_lname |
+-----------+-----------+---------------------+---------------+-------------
--+
| Daevid | Vincent | --N/A-- | daevid | vincent
|
| Daevid | Vincent | --N/A-- | jim | sawicki
|
| Daevid | Vincent | No Name Dept | Eric | Johnson
|
| NULL | NULL | NULL Rep Department | NULL | NULL
|
+-----------+-----------+---------------------+---------------+-------------
--+
4 rows in set (0.00 sec)
Now, can you tell me what that INNER JOIN is and why you used it? Is that
the same as
FROM company_table, dept_table WHERE company_id = dept_company_table_id
[However replacing that in the example above didn't work]
http://exchange.manifold.net/manifold/manuals/5_userman/mfd50INNER_JOIN_Oper
ation.htm
Says it's the most common join, but I thought that STRAIGHT JOIN or simply
"," was?
And the attached link makes no mention of INNER JOINs