Results 1 to 2 of 2

Thread: ORA-00913: too many values

  1. #1
    Join Date
    Apr 2004
    Posts
    3

    ORA-00913: too many values

    Hello,

    I've been trying to figure out how to fix the above error msg on my UPDATE table statement. Any help will be appreciated..


    UPDATE course_stats
    SET num_sections = (SELECT course_no, COUNT(section_id)
    FROM section
    GROUP BY course_no),
    num_students = (SELECT c.course_no,
    COUNT(e.section_id) "Total Students"
    FROM course c, section se, enrollment e
    WHERE se.section_id = e.section_id
    AND c.course_no = se.course_no
    GROUP BY c.course_no),
    num_instructors = (SELECT c.course_no,
    COUNT(se.instructor_id) "Total
    Instructor"
    FROM course c, section se
    WHERE c.course_no = se.course_no
    GROUP BY c.course_no);


    Name Null? Type
    COURSE_NO NOT NULL NUMBER(8)
    DESCRIPTION NOT NULL VARCHAR2(50)
    COST NUMBER(9,2)
    PREREQUISITE NUMBER(8)
    NUM_SECTIONS NOT NULL NUMBER(8)
    NUM_STUDENTS NOT NULL NUMBER(8)
    NUM_INSTRUCTORS NOT NULL NUMBER(8)

  2. #2
    Join Date
    Apr 2004
    Location
    Sweden
    Posts
    3
    Might be useful to you

    The SQL statement requires two sets of values equal in number. This error occurs when the second set contains more items than the first set. For example, the subquery in a WHERE or HAVING clause may return too many columns, or a VALUES or SELECT clause may return more columns than are listed in the INSERT.

    Action: Check the number of items in each set and change the SQL statement to make them equal.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •