Regexp_like function Begin with character
We have requirement to display as 'Y' whenever the product line begin with in the provided list of values. The list of values may changed based requirement. So, we have created custom table to capture these values. But query is not working as expected when comparing multiple values.
With Pstg As
(Select 'comp2' Item, '600241' Product_Line From Dual
Union All
Select 'comp2' Item, '2' Product_Line From Dual)
Select Item,
Product_Line,
Nvl((Select 'Y' From Dual Where Regexp_Like(Product_Line, '2')), 'N') V3
From Pstg;
Result:
Here the product line '600241' is not starting with '