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?