ORA-00905 missing keyword on JOIN
hii'm getting a ORA-00905 on the AS keyword in the SQL below. I've tried removing the AS but that didn't help. Any suggestions?
select tv.monitorname as "Monitor Name", count(tv.typeofvisit) as "# of Visits", count(to_date(l.submitdate, 'mm/dd/yyyy')- (l.visitend+16)) as "# Late", count(to_date(ot.submitdate, 'mm/dd/yyyy') - (ot.visitend+16)) as "# On Time"
FROM Form_CTOMonitor tv
left outer JOIN (select l.monitorname FROM Form_CTOMonitor where ((to_date(l.submitdate, 'mm/dd/yyyy') >(l.visitend+16)))) AS l ON (l.monitorname = tv.monitorname)
LEFT outer JOIN (select ot.monitorname FROM Form_CTOMonitor where ((to_date(ot.submitdate, 'mm/dd/yyyy') <= (ot.visitend+16)))) as ot ON (l.monitorname = ot.monitorname)
select tv.monitorname as "Monitor Name", count(tv.typeofvisit) as "# of Visits", count(to_date(l.submitdate, 'mm/dd/yyyy')- (l.visitend+16)) as "# Late", count(to_date(ot.submitdate, 'mm/dd/yyyy') - (ot.visitend+16)) as "# On Time"
FROM Form_CTOMonitor tv
left outer JOIN (select l.monitorname FROM Form_CTOMonitor where ((to_date(l.submitdate, 'mm/dd/yyyy') >(l.visitend+16)))) AS l ON (l.monitorname = tv.monitorname)
LEFT outer JOIN (select ot.monitorname FROM Form_CTOMonitor where ((to_date(ot.submitdate, 'mm/dd/yyyy') <= (ot.visitend+16)))) as ot ON (l.monitorname = ot.monitorname)
0