Re: Can you specify multiple tables in update's where clause?

From: Hans Noordhof <kinetics.delete.or.remove_at_dds.nl>
Date: Sat, 21 Jul 2001 21:07:39 GMT
Message-ID: <9eiho8$70i03$1_at_reader01.wxs.nl>


 update table_a
 set table_a.my_col = 'Like This'
 where table_a.col_a in

         (select table_x.col_b
          from    table_x
          ,           table_y
          where table_x.col_b= table_y.col_d
         )

Hans Noordhof <kinetics.delete.or.remove_at_dds.nl> schreef in berichtnieuws 9eifm3$6vfma$1_at_reader01.wxs.nl...
> Try this
>
> update table_a
> set table_a.my_col = 'Like This'
> where table_a.col_a in
> (select table_x.col_b
> from table_x
> , table_y
> where table_x.col_x= table_y.col_d
> )
>
> And buy an SQL-book.
>
> change <changeme_at_changeme> schreef in berichtnieuws
> 9ei2f5$dh01_at_kcweb01.netnews.att.com...
> > Need some sql expert input on UPDATE command. How do I involve multiple
> > tables in WHERE clause?
> >
> > Consider this simplified example on update command:
> >
> > UPDATE TABLE_A
> > SET TABLE_A.my_col = "thisThat"
> > WHERE
> > TABLE_A.col_a = TABLE_X.col_b
> > and TABLE_X.col_c = TABLE_Y.col_d
> >
> >
> > This fails with a message that table2 is not in scope! How do I involve
> > multiple tables in the where clause of an update? Can't seem to find an
> > example in any book/webpage.
> >
> > Comments?
> >
> > essbee
> >
> > (I am using Oracle 8.1.5, though this seems to be a generic SQL
 question)
> >
> >
>
>
Received on Sat Jul 21 2001 - 23:07:39 CEST

Original text of this message