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: newbie sql question

Re: newbie sql question

From: R. Steven Brown <rstevenbrown_at_earthlink.net>
Date: Sun, 11 Apr 1999 15:54:29 -0600
Message-ID: <7er5ms$443$1@holly.prod.itd.earthlink.net>


I've had Oracle respond oddly to mixed-case column or table names before. I'd give it a try with all upper-case(remove the "s from the view def.) Hope it Helps
Steve Brown

Vic Smyth <vicsmyth_at_megsinet.net> wrote in message news:371133AF.AAB_at_megsinet.net...
>Hi,
>
>I'm doing a project for class using Oracle Sqlplus and am stuck on a
problem.
>I've created a view and am trying to query the view but get an error
message.
>Any help would be appreaciated!
>
>Here's what I have, the error message is below.
>
>Vic
>
>To reply to email remove the "myth" from the address.
>
>SQL> CREATE VIEW TEMPX AS
> 2 SELECT INVOICE.CUS_CODE "C_Code", COUNT(DISTINCT
>INVOICE.INV_NUMBER)"Inv_Nu
>m",
> 3 SUM(LINE_UNITS*LINE_PRICE)"SumOfLine"
> 4 FROM INVOICE, LINE
> 5 WHERE INVOICE.INV_NUMBER = LINE.INV_NUMBER
> 6 GROUP BY INVOICE.CUS_CODE;
>
>View created.
>
>SQL> select * from tempx;
>
>C_Cod Inv_Num SumOfLine
>----- --------- ---------
>10011 3 444
>10012 1 153.85
>10014 2 422.77
>10015 1 34.97
>10018 1 70.44
>
>SQL> DESCRIBE TEMPX;
> Name Null? Type
> ------------------------------- -------- ----
> C_Code NOT NULL CHAR(5)
> Inv_Num NUMBER
> SumOfLine NUMBER
>
>SQL> SELECT SUM(Inv_Num),SUM(SumOfLine),MIN(SumOfLine),
> 2 MAX(SumOfLine),AVG(SumOfLine)
> 3 FROM TEMPX;
>MAX(SumOfLine),AVG(SumOfLine)
> *
>ERROR at line 2:
>ORA-00904: invalid column name
>
>
>SQL>
Received on Sun Apr 11 1999 - 16:54:29 CDT

Original text of this message

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