Is there any way possible to use a range in the IN clause of sql.
I have a scenario where I have the values in the column like:
BIN_1_1 111111 - 222222 The user enters a value, eg; 111134, and I need to check if the value entered lies within the range in the column value.
Is there any way to use IN statement and use between in it ?
FOR i in (select * from V_CUS_SEG_BIN_RANGE) LOOP IF v_input1 IN (REGEXP_SUBSTR(i.bin_1_1, '[^-]+', 1, 1), REGEXP_SUBSTR(i.bin_1_1, '[^-]+', 1, 2) THEN dbms_output.put_line('Duplicate!'); END LOOP; I get the values separated with RegEx, but can I use between to compare if the values lies in between the range.
inworks. Just use>=and<=.111111and222222were in separate columns ofINT. As it is, anything could be in a column that allows the value111111 - 222222, which makes many methods of solving this very fragile.