question

jakey72 avatar image
jakey72 asked

case statement

I have a data set with three fields : RS / ABC / ~ RS / RCS / Pink RS / BDE / Pink BD / JEG / ~ BD / KEG / Red BD / PCO / Red So, I want to update RS ABC to be Pink and BD JEG to be Red using a case statement. When I write the case statement BD JEG is Pink and then RS ABC is Red. How can group all RS data to be Pink and all BD data to be Red when ~ is an indicator in both pink and red?
case-statement
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Grant Fritchey avatar image
Grant Fritchey answered
Not sure you would need a case statement. Wouldn't a simple WHERE clause get the job done? UPDATE MyTable SET Color = 'Red' WHERE ColumnA = 'BD' AND Color = '~';
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.