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 VIEW with * and other stuff?

Re: CREATE VIEW with * and other stuff?

From: Jurij Modic <jurij.modic_at_mf.sigov.mail.si>
Date: 1998/03/09
Message-ID: <3503b641.4704840@www.sigov.si>#1/1

On Mon, 09 Mar 1998 01:20:45 GMT, derman_at_mindspring.com (Jon Derman) wrote:

>Given that one can create a view of a table with something like this:
>
>CREATE VIEW TEST_VIEW AS
> SELECT * FROM TEST;
>
>...is there a simple way to create a view that contains everything in
>a given table -- plus a couple of other things (calculated things, for
>example) -- without having to list everything out? Something like
>this:
>
>CREATE VIEW TEST_VIEW AS
> SELECT *, A+B, SUBSTR(C,1,1) FROM TEST;
You must prefix "*" with table name or its alias and you must supply column aliases for all derived columns, so in your example you should use something like:

CREATE VIEW TEST_VIEW AS
  SELECT test.*, A+B additional_col1, SUBSTR(C,1,1) additional_col2   FROM TEST; Regards,


Jurij Modic                             Republic of Slovenia
jurij.modic_at_mf.sigov.mail.si		Ministry of Finance
============================================================
The above opinions are mine and do not represent any official standpoints of my employer Received on Mon Mar 09 1998 - 00:00:00 CST

Original text of this message

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