Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ORACLE UPPER applied to IN condition

I have an Oracle query in which I would like to apply the UPPER function to all the values in the IN condition, instead of explicitly calling UPPER on each value, ex.

SELECT * FROM a WHERE b IN UPPER(v1, v2, v3, v4);

instead of

SELECT * FROM a WHERE b IN (UPPER(v1), UPPER(v2), UPPER(v3), UPPER(v4));

Any help would be most appreciated.

like image 867
mark Avatar asked Dec 06 '25 20:12

mark


1 Answers

You can do (almost) that by turning off case sensitivity:

alter session set NLS_COMP=ANSI;
alter session set NLS_SORT=BINARY_CI;

select * from A where B in (v1, v2, v3, v4)
like image 86
vav Avatar answered Dec 08 '25 14:12

vav



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!