-
multiple inner join error
Hi everyone, I am trying to do a query with 7 different tables by using the inner joint. When I run it it sais
ERROR at line 15:
ORA-00905: missing keyword
Any ideas what it could be?
HTML Code:
SELECT FUNCTIONS.FUN_NAME, FUNCTIONS.FUN_ID, FUNCTIONS.FUN_NAME,
EQUIPMENTS_FUNCTIONS.EQUIP_DESCRIPTION, HIRE_EQUIPMENTS.HEQUIP_DESCRIPTION,
STAFFS.EMP_TITTLE
FROM FUNCTIONS,EQUIPMENTS_FUNCTIONS,FUNCTIONS_HIRE_EQUIPMENTS,FUNCTIONS_STAFFS
INNER JOIN
EQUIPMENTS_FUNCTIONS ON FUNCTIONS.FUN_ID = EQUIPMENTS_FUNCTIONS.FUN_ID JOIN
INNER JOIN
EQUIPMENTS_FUNCTIONS ON EQUIPMENTS_ID.EQUIP_ID = EQUIPMENTS.EQUIP_ID
INNER JOIN
FUNCTIONS_HIRE_EQUIPMENTS ON FUNCTIONS.FUN_ID = FUNCTIONS_HIRE_EQUIPMENTS.FUN_ID
INNER JOIN
FUNCTIONS_STAFFS ON FUNCTIONS.FUN_ID = FUNCTIONS_STAFFS.FUN_ID
INNER JOIN
STAFFS ON FUNCTIONS_STAFFS.EMP_ID = STAFFS.EMP_ID
WHERE FUNCTIONS.FUN_ID = 'F20031235';
-
Too many JOINs or too few SELECTs?
You got two joins together:
Code:
-- Etc...
INNER JOIN
EQUIPMENTS_FUNCTIONS ON FUNCTIONS.FUN_ID = EQUIPMENTS_FUNCTIONS.FUN_ID JOIN
INNER JOIN
-- Etc...
"The person who says it cannot be done should not interrupt the person doing it." --Chinese Proverb
-
Im getting mental!!
I got rid of the extra join there, but it keeps giving me an error.
ERROR at line 6:
ORA-00904: "FUNCTIONS"."FUN_ID": invalid identifier
Any idea in what is the best way to do this?
-
desc MyTable
Originally Posted by virkof
I got rid of the extra join there, but it keeps giving me an error.
ERROR at line 6:
ORA-00904: "FUNCTIONS"."FUN_ID": invalid identifier
Any idea in what is the best way to do this?
Maybe use the correct column names that are defined in each table?
"The person who says it cannot be done should not interrupt the person doing it." --Chinese Proverb
-
try this
SELECT FUNCTIONS.FUN_NAME, FUNCTIONS.FUN_ID, FUNCTIONS.FUN_NAME,
EQUIPMENTS_FUNCTIONS.EQUIP_DESCRIPTION, HIRE_EQUIPMENTS.HEQUIP_DESCRIPTION,
STAFFS.EMP_TITTLE
FROM FUNCTIONS,EQUIPMENTS_FUNCTIONS,FUNCTIONS_HIRE_EQUIPMENTS,FUNCTIONS_STAFFS
WHERE FUNCTIONS.FUN_ID = 'F20031235'
and
FUNCTIONS.FUN_ID = EQUIPMENTS_FUNCTIONS.FUN_ID
and
EQUIPMENTS_ID.EQUIP_ID = EQUIPMENTS.EQUIP_ID
and
FUNCTIONS.FUN_ID = FUNCTIONS_HIRE_EQUIPMENTS.FUN_ID
and
FUNCTIONS.FUN_ID = FUNCTIONS_STAFFS.FUN_ID
and
FUNCTIONS_STAFFS.EMP_ID = STAFFS.EMP_ID
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|