Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Query returning a missing expression error

Re: Query returning a missing expression error

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Sun, 23 Jun 2002 07:23:05 +0200
Message-ID: <uhao1b8p35b476@corp.supernews.com>

<whyme_at_nowhere.com> wrote in message
news:cg4ahuobhgg2v7d6p48nlcb96oqng3jl08_at_4ax.com...
> Here is my query:
>
> SELECT SUM(max_enrl), AVG(max_enrl), MAX(max_enrl), MIN(max_enrl),
> FROM course_section
> WHERE term_id = 2;
>
> ERROR at line 2:
> ORA-00936: missing expression
>
> What expression am I missing?
>
> Here is the table:
>
>
> CREATE TABLE COURSE_SECTION
> (c_sec_id NUMBER(6),
> course_id NUMBER(6) CONSTRAINT course_section_courseid_nn NOT NULL,
> term_id NUMBER(6) CONSTRAINT course_section_termid_nn NOT NULL,
> sec_num NUMBER(2) CONSTRAINT course_section_secnum_nn NOT NULL,
> faculty_id NUMBER(5),
> day VARCHAR2(10),
> time DATE,
> bldg_loc VARCHAR2(10),
> loc_id NUMBER(6),
> max_enrl NUMBER(4) CONSTRAINT course_section_maxenrl_nn NOT NULL,
> CONSTRAINT course_section_csec_id_pk PRIMARY KEY (c_sec_id),
> CONSTRAINT course_section_cid_fk FOREIGN KEY (course_id) REFERENCES
> course(course_id),
> CONSTRAINT course_section_loc_id_fk FOREIGN KEY (loc_id) REFERENCES
> location(loc_id),
> CONSTRAINT course_section_termid_fk FOREIGN KEY (term_id) REFERENCES
> term(term_id),
> CONSTRAINT course_section_fid_fk FOREIGN KEY (faculty_id) REFERENCES
> faculty(faculty_id));
>
>
> Thanks

You have a redundant comma

> SELECT SUM(max_enrl), AVG(max_enrl), MAX(max_enrl), MIN(max_enrl),

                                            ^ right here!

> FROM course_section
> WHERE term_id = 2;

Hth

--
Sybrand Bakker
Senior Oracle DBA

to reply remove '-verwijderdit' from my e-mail address
Received on Sun Jun 23 2002 - 00:23:05 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US