List:General Discussion« Previous MessageNext Message »
From:Daevid Vincent Date:April 24 2003 9:56pm
Subject:RE: INNER JOIN? Was: Can I do two LEFT JOINs in one SELECT?
View as plain text  
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

Thread
Can I do two LEFT JOINs in one SELECT?Daevid Vincent24 Apr
  • RE: Can I do two LEFT JOINs in one SELECT?Uttam24 Apr
    • RE: INNER JOIN? Was: Can I do two LEFT JOINs in one SELECT?Daevid Vincent24 Apr
  • Re: Can I do two LEFT JOINs in one SELECT?Brent Baisley24 Apr
  • Re: Can I do two LEFT JOINs in one SELECT?Joshua J . Kugler24 Apr
RE: INNER JOIN? Was: Can I do two LEFT JOINs in one SELECT?Uttam25 Apr