I have a requirement like below.
and if my COL1 has any of ABC or DEF then it should make another entry say 'XYZ' like below.
When i use a case statement like below.
INSERT INTO TABLE A SELECT 'XYZ' FROM TABLE A WHERE COL1 = 'ABC' OR COL1='DEF' . But this statement inserts 2 rows as there are 2 matches. How can i narrow it down to just one 'XYZ'.
Thanks in advance.
This should work
INSERT INTO TABLE A SELECT DISTINCT('XYZ') FROM TABLE A WHERE COL1 = 'ABC' OR COL1='DEF'