Home » RDBMS Server » Server Administration » Selective update
Selective update [message #372480] Wed, 14 February 2001 14:34 Go to next message
Robbie
Messages: 2
Registered: February 2001
Junior Member
I am trying to update fielda and fieldb in tablea from fielda and fieldb in tableb,
but only wish to update tablea with fielda and fieldb when their value in tableb is not nulls/spaces

Any thoughts?
Re: Selective update [message #372488 is a reply to message #372480] Thu, 15 February 2001 03:35 Go to previous message
amarpatgiri
Messages: 11
Registered: December 2000
Junior Member
Try something like this?

update emp e set dept = ( select dept from
emp1 e1 where e.empno = e1.empno and e1.dept is not null),
birthdate = (select birthdate from emp1 e1
where e.empno = e1.empno and e1.birthdate is not null)

-amar
Previous Topic: Cascade Delete? How do I implement this??
Next Topic: Returing some thing like a "result set" from a Stored Procedure
Goto Forum:
  


Current Time: Wed May 15 15:14:31 CDT 2024