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: CREATE TABLE AS SELECT

Re: CREATE TABLE AS SELECT

From: <shiling_at_math.wayne.edu>
Date: Fri, 25 Jun 1999 21:27:42 GMT
Message-ID: <7l0s81$g3h$1@nnrp1.deja.com>


I'm afraid not. But you can do it as simple as that,

SQL> create table t
  2 (deptno NUMBER(4),tepttot number(10,2));

Table created.

SQL> insert into t
  2 select deptno, sum(sal)
  3 from emp
  4 group by deptno;

3 rows created.

SQL> select * from t;

   DEPTNO TEPTTOT
--------- ---------

       10      8750
       20     10875
       30      9400

In article <37736fb2.1063919_at_news.earthlink.net>,   Jeremy.Russell_at_I-got-all-the-spam-i-need.usa.net (Jeremy Russell) wrote:
> Running the following SQL statement creates a summary table from
> SCOTT's employee table. Using 'depttot' as an alias allows me to name
> the aggregate column - but how can I assign a specific scale and
> precision to that column?
>
> CREATE TABLE emp_summary AS
> SELECT deptno, sum(sal) depttot
> FROM emp
> GROUP BY deptno
>
> Thanks ...
>
> Jeremy Russell
>
>

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't. Received on Fri Jun 25 1999 - 16:27:42 CDT

Original text of this message

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