Home » SQL & PL/SQL » SQL & PL/SQL » Need Help
Need Help [message #36966] Tue, 08 January 2002 01:11 Go to next message
Sandipta N Biswas
Messages: 7
Registered: December 2001
Junior Member
hi,
SQL> desc t1;
Name Null? Type
------------------------------- -------- ----
E NUMBER(38)
F NUMBER(38)

SQL> desc t2;
Name Null? Type
------------------------------- -------- ----
A NUMBER(38)
B CHAR(10)

I want to update the column E of T1 with the value of Columb A of T2 where value of A is 555.
What will be the SQL?
adv. thanx.
sandipta
Re: Need Help [message #36967 is a reply to message #36966] Tue, 08 January 2002 04:00 Go to previous message
tinel
Messages: 42
Registered: November 2001
Member
Hi
The statement is:
update t1 set e = (select distinct A from t2 where A = 555);
But you will need a where clause in update statement otherwise all rows from table t1 will be updated.

Bye
Previous Topic: Insert from multiple columns into multiple rows
Next Topic: foreign key and primary key
Goto Forum:
  


Current Time: Thu Apr 18 14:17:39 CDT 2024