Keep getting an error when trying to create a view with an inner join:
CREATE OR REPLACE VIEW lab3view3
AS
SELECT
f.firstname,
f.lastname,
s.firstname,
s.lastname,
c.coursename,
sec.days,
TO_CHAR (sec.starttime, 'MM/DD/YYYY') AS startdate,
TO_CHAR(sec.starttime, 'HH:MI AM ') AS starttime,
TO_CHAR(sec.endtime, 'MM/DD/YYYY') AS enddate,
TO_CHAR(sec.endtime, 'HH:MI AM ') AS endtime,
sec.sectionid,
l.building,
l.room,
g.grade
FROM section sec
INNER JOIN grade g
ON g.sectionid = sec.sectionid
INNER JOIN course c
ON c.courseid = sec.courseid
INNER JOIN location l
ON l.locationid = sec.locationid
INNER JOIN student s
ON s.studentid = g.studentid
INNER JOIN instructor i
ON i.sectionid = sec.sectionid
INNER JOIN faculty f
ON f.facultyid = i.facultyid
INNER JOIN section sec
ON sec.sectionid = g.sectionid;
Keep getting this error:
ERROR AT LINE 1;
ORA-00918:column ambiguously defined
Any ideas on how to fix this?