79475938

Date: 2025-02-28 15:06:56
Score: 0.5
Natty:
Report link

Here is a simple solution with a subquery. In the subquery we find records where Flag_Val is equal to "N".

SELECT Rec_ID, Flag_Val FROM table1 WHERE Flag_Val = 'Y' AND
Rec_ID IN (SELECT Rec_ID FROM table1 WHERE Flag_Val = 'N');
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Ivan Yuzafatau