Skip to main content

Case Statement Returning the same Value in many Instances

  • January 25, 2022
  • 1 reply
  • 55 views

waidyah
Do Gooder (Partner)
Forum|alt.badge.img+7
  • Do Gooder (Partner)
  • 18 replies

The requirement was like this:


       CASE 
         WHEN SUBSTR(PART_NO, 1, 2) IN('XX', 'YY', 'ZZ')  THEN
           SUBSTR(PART_NO, 1, 2)
         ELSE
           'SP'
       END CODE,

See also >>

multiple values in case statement | Toolbox Tech

This topic has been closed for replies.

1 reply

Forum|alt.badge.img+10
  • Sidekick (Customer)
  • 107 replies
  • February 26, 2022

@waidyah , what is the exact requirement , as per the case statement , if the first 2 letters are in (‘XX’,’YY’,’ZZ’)  then it will return the first two letters which are going to be same , if not it will bring ‘SP’ . It depends on your data. try to analyze the data and explain the requirment clearly.