Link to home
Start Free TrialLog in
Avatar of chalie001
chalie001

asked on

update records for the following conditions

hi i what to update records for following conditions

Extract all records where DM is 17 and all parts linked to the NSNs and all users linked.

If 17 is the only user and DM - change 17 to 05.
If 05 is a user - change DM 17 to 05 and delete user 05
If 05 is not a user - change DM to 05

Only the IUG_SEQ will change IF THE IUG = 1 FOR 17.


Only when the IUG_SEQ = 1 FOR 17 THEN IT WILL CHANGE TO 2, 3 , 4 OR 5
THEN THE IUG_SEQ WILL BE 1 FOR 05


this the table
NOC_ITEM_USRGRP
User generated image
User generated image
Avatar of Bembi
Bembi
Flag of Germany image

Hello,

the general syntax would be like this...
Update TableName
Set ColumName = Value
Where ....

The where clause is the same than in the select statement. 
Avatar of chalie001
chalie001

ASKER

i know general syntax
DM  = usr_usrgrp_code
Can you provide some sample data with expected result? That would be easy for anyone to play around with the data to write the query.
check
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.