Home » RDBMS Server » Server Utilities » update statement help .... URGENT !!!
update statement help .... URGENT !!! [message #71636] Fri, 06 December 2002 12:28 Go to next message
Arpit
Messages: 99
Registered: March 2001
Member
Hello All,

I need your help on the update statement.

I need to update a column of table 1 making a comparison on unique column that exists in two tables, table1 and table2.

Eg:

Table1 Table2
------- ---------
Product_no Product_No
Expiry_date
Status

I need to update the expiry_date on table1 making a join on table1.product_no=table2.product_no.

Need to update the expiry date on table1 for only those produt_no that exists in both tables.

Your help on this would be highly appreciated.

Thanks!
Re: update statement help .... URGENT !!! [message #71640 is a reply to message #71636] Sun, 08 December 2002 12:45 Go to previous message
sai sreenivas jeedigunta
Messages: 370
Registered: November 2001
Senior Member
hello see if this works

update table1 a set expiry_date='date'
where exists(select product_no from table2 b
where a.product_no=b.product_no);

sai
Previous Topic: imp fails from on schema to antoher
Next Topic: Hello
Goto Forum:
  


Current Time: Mon Dec 23 16:56:20 CST 2024