Error Code: 904, SQL State: 42000] ORA-00904: "G"."NAME": invalid
654905Feb 24 2011 — edited Feb 24 2011When I run the SQL below, I receive the following:
08:00:08 [SELECT - 0 row(s), 0.000 secs] [Error Code: 904, SQL State: 42000] ORA-00904: "G"."NAME": invalid identifier
When I comment out the BOLD lines, it runs okay. I've tried fully qualifying the column with no success. I'm sure it's a formatting issue.
************************************************
Select
sr.schoolid,
sr.studentid, sr.coursenumber,
sr.REGISTREQ_ID,
(select
min(rr.ID||'-'||rr.COURSEGROUP)
from
REGISTREQ rr
where
rr.grade_level = (select s.sched_nextyeargrade from students s where sr.studentid = s.id)
and rr.yearid = 2100
and rr.id not in (6426,6415)
and rr.COURSEGROUP in
(select
g.name
from
gen g
where
g.CAT = 'coursegroups'
and instr(g.valuet, sr.coursenumber) > 0
and g.schoolid = sr.schoolid)
and ((g.name like '%ALT%' and sr.GLOBALALTERNATECOURSE=1)
or (g.name not like '%ALT%' and sr.GLOBALALTERNATECOURSE=0))
) as New_RegID
from
SCHEDULEREQUESTS sr
where
sr.schoolid = 703
and sr.yearid = 2100