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 -> 2 Dumb newbee questions

2 Dumb newbee questions

From: Matthias Weiß <matthiasUNDERSCOREweiss_at_gmx.at>
Date: Fri, 16 Jul 2004 22:27:10 +0200
Message-ID: <40f83ae3@e-post.inode.at>


Hallo!

I know a little about SQL but I stumbled over code on an oracle server which I don't understand:

create table foo as
  select no, um
  from bar
  where 1=2

As far as I get it, this creates the new table foo with the colums no and um which have the same types as the colums with the same name in the table bar. But what is this "where 1=2" ???

And one last:

update
(
  select
    ck.col_1,
    ck.col_2,
    col_3,
    ck.col_4,
    col_5
  from foo i, bar ck

  where i.col_1     = ck.col_1
    and i.col_2     = ck.col_2

)
set col_1 = col_3,

     col_2 = col_5

How do I see in this construct which table is updated? The inner select statement returns 5 columns, but only 2 get updated, so what's the point of this select?

Thanx in advance for any help!!!

Ciao
matthias Received on Fri Jul 16 2004 - 15:27:10 CDT

Original text of this message

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