Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help !! updating the results of select

Status
Not open for further replies.

nkshirsa

Programmer
Apr 7, 2011
2
IN
Hello,

I have a table caxnode which has fields node_alias, node_mode, node_id, etc..

In some cases, the node_alias is marked as "regular" as well as 'logical' for different node_id's. I want to change the entries for which the same node_alias is marked 'regular' as well as 'logical' to logical. i.e. change the "regular" to "logical" if the same entry is marked 'logical' in the table and is an LDOM partition ..

This is my working query to return the results that I am interested in changing..

select Node_ID, Node_type, Num_of_proc, Node_Alias, Host_ID, Node_mode, Partition_Type from CAXNODE nd where (Node_mode = 'VIRTUAL' or Node_mode = 'REGULAR') and Node_Alias in (select nd2.Node_Alias from CAXNODE nd2 where nd2.Node_mode = 'LOGICAL' and Partition_Type = 'LDOM' ) ;

Now I want to change the values to set Node_mode to 'LOGICAL'; Partition_Type to 'LDOM', Host_ID to (nd2.Host_ID); Num_of_proc to (nd2.Num_of_proc);

How can I do this in one update statement?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top