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 -> as in SQL

as in SQL

From: Chris Eastwood <c.undieseastwood_at_gu.edu.au>
Date: Fri, 18 Dec 1998 02:17:44 GMT
Message-ID: <75cafk$bql$1@kraken.itc.gu.edu.au>


HiYa

I am interested in a piece of SQL that I have just seen, I don't understand the need for the AS clause in the select statement.

IE

CREATE TABLE bill
(

    VERS,         
    CAT_NAME,     
    ITEM_TYPE,    
    ITEM,         
    OLD_ITEM,     
    ACCNBR_ACC,   
    SECMASK1,     

    OLD_SECMASK1,
    SECMASK2
)                   
AS                 <--- I understand this one ...
SELECT              
    VERS,           
    CAT_NAME,       
    ITEM_TYPE,      
    replace(ITEM,'98','99') as ITEM,     <---- but not this
    ITEM AS OLD_ITEM,
    ACCNBR_ACC,
    replace(SECMASK1, '98','99') as SECMASK1, <--- or this     SECMASK1 as OLD_SECMASK1,
    SECMASK2
FROM
blah blah blah
);

surely the table bill would be created the positional order of the colum names?? Even then the column could be aliased.

Thanks

See Ya
(when bandwidth gets better ;-)

Chris Eastwood

Photographer, Programmer               email    ua.ude.ug.cti_at_doowtsae.c
Motorcyclist and dingbat               WWW   http://chrise.itc.gu.edu.au


please remove undies for reply



Ohhh ... you work all day, slave over a hot stove all night  yet you *still* have time for sadomasochism ... how do you do it?

A little man hurts me.

<ding>

    Oh Mister Mean ... Oh Mister Mean
    15 Minutes with him and you'll be blue and green     Studded belts and leather whips
    Bondage trousers on his hips
    Wack and punish as you dust with Mister Mean   Ohhhh he whips me around the house in minutes ... lets get cracking ... Received on Thu Dec 17 1998 - 20:17:44 CST

Original text of this message

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