Single row update from multiple table



IBM's flagship relational database management system

Single row update from multiple table

Postby jvinoth » Wed Sep 24, 2014 9:11 pm

Hi can anyone please let me know how to prepare the update query for the below select

SELECT * FROM tableh H, tablef F, tabeo O
WHERE H.CODE = '01' AND H.CODE = F.CODE
AND H.CODE = O.CODE
AND F.STORE = '0420' AND F.STORE = O.STORE
AND H.NO = F.NO AND H.NO = O.NO
AND H.ITM = F.ITM AND H.ITM = O.ITM
AND H.SK = F.SK AND H.SK = O.SK
AND F.TYPE=’BP’
WITH UR;

I need to update F.TYPE alone.
jvinoth
 
Posts: 132
Joined: Fri Nov 18, 2011 3:13 pm
Has thanked: 0 time
Been thanked: 1 time

Re: Single row update from multiple table

 

Re: Single row update from multiple table

Postby NicC » Thu Sep 25, 2014 3:43 am

You should not be using * - you should specify the column names.

What do you want to update F.type with? And under what coditions? Your SELECT would appear to have no relevance.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times


Return to DB2

 


  • Related topics
    Replies
    Views
    Last post