I have a scenerio where i have to update all the rows but one out of many rows.Say I have a table like
__________________________________________________________
|COlA | COLB | COLC | COLD | COLE |
-----------------------------------------------------------
|Equipment SI | ADD INFO | MERGE | Notes | Y |
|Equipment SI | Active | MERGE | Notes | Y |
|Equipment SI | ORIGINAL | MERGE | Notes | Y |
|Fastening | ADD INFO | MERGE | Notes | Y |
|Fastening | Active | MERGE | Notes | Y |
|Electonics | ADD INFO | MERGE | Notes | Y |
|Electonics | Active O | MERGE | Notes | Y |
|Electonics | ORIGINAL | MERGE | Notes | Y |
|Electonics | Nominated| MERGE | Notes | Y |
|Fiber | ADD INFO | MERGE | Notes | Y |
|Fiber | ADD INFO | MULTI | Notes | Y |
|Fiber | ADD INFO | KILO | Notes | Y |
Now i need to get the ouput like
__________________________________________________________
|COlA | COLB | COLC | COLD | COLE |
-----------------------------------------------------------
|Equipment SI | ADD INFO | MERGE | Notes | Y |
|Equipment SI | Active | MERGE | Notes | N |
|Equipment SI | ORIGINAL | MERGE | Notes | N |
|Fastening | ADD INFO | MERGE | Notes | Y |
|Fastening | Active | MERGE | Notes | N |
|Electonics | ADD INFO | MERGE | Notes | Y |
|Electonics | Active O | MERGE | Notes | N |
|Electonics | ORIGINAL | MERGE | Notes | N |
|Electonics | Nominated| MERGE | Notes | N |
|Fiber | ADD INFO | MERGE | Notes | Y |
|Fiber | ADD INFO | MULTI | Notes | Y |
|Fiber | ADD INFO | KILO | Notes | Y |
I'm trying to update the COLE
to 'N'(Except one row) from 'Y' .COLA,COLD,COLE
should be same to update that particular set. If any row(COLA,COLC,COLD)combination has only one 'Y' then i should not update anything(Fiber in my sample data).I have to update the entire table. Can someone help me on this. Should i create a function and loop through it? In that also how to update only one row?