From: Daevid Vincent Date: April 24 2003 9:56pm Subject: RE: INNER JOIN? Was: Can I do two LEFT JOINs in one SELECT? List-Archive: http://lists.mysql.com/mysql/138315 Message-Id: <000101c30aac$6e9977f0$a50aa8c0@Locutus> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0002_01C30A71.C23A9FF0" ------=_NextPart_000_0002_01C30A71.C23A9FF0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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 =3D dept_company_table_id -> LEFT JOIN contact_table ON dept_id =3D contact_dept_table_id -> LEFT JOIN rep_table ON dept_rep_table_id =3D rep_id -> WHERE company_id =3D '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=20 FROM company_table, dept_table WHERE company_id =3D = dept_company_table_id [However replacing that in the example above didn't work] http://exchange.manifold.net/manifold/manuals/5_userman/mfd50INNER_JOIN_O= per 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 ------=_NextPart_000_0002_01C30A71.C23A9FF0--