Multiple Joins

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I am trying to do two inner joins to the same table and am getting a syntax error...I would appreciate any help.

Thanks



SELECT FSR.ID, FSR_PEOPLE.FIRST_NAME + " " + FSR_PEOPLE.LAST_NAME AS FUNCTIONAL_ANALYST,
FSR_PEOPLE.FIRST_NAME + " " + FSR_PEOPLE.LAST_NAME AS SUBMITTED_BY
FROM FSR INNER JOIN FSR_PEOPLE ON (FSR_PEOPLE.ID = FSR.FUNCTIONAL_ANALYST_ID)
INNER JOIN FSR_PEOPLE ON (FSR_PEOPLE.ID = FSR.SUBMITTED_BY_ID)
;
 
You might try something like:

SELECT
FSR.ID,
FUNCTIONAL_ANALYSTS.FIRST_NAME + " " + FUNCTIONAL_ANALYSTS.LAST_NAME AS
FUNCTIONAL_ANALYST,
SUBMITTERS.FIRST_NAME + " " + SUBMITTERS.LAST_NAME AS SUBMITTED_BY
FROM
(FSR
INNER JOIN
FSR_PEOPLE AS FUNCTIONAL_ANALYSTS
ON
FSR.FUNCTIONAL_ANALYST_ID = FUNCTIONAL_ANALYSTS.ID)
INNER JOIN
FSR_PEOPLE AS SUBMITTERS
ON
FSR.SUBMITTED_BY_ID = SUBMITTERS.ID

James Laughlin said:
Hi,

I am trying to do two inner joins to the same table and am getting a
syntax error...I would appreciate any help.
 
Back
Top