I have a column that is a string and I want to find all records where the string starts with one of the following:
'RIRV', 'RIUI', 'RIRI', 'RICJ', 'RIRE', 'RIRF', 'RIAW', 'RIAS', 'RINA'
So they all start RI
and must be followed by: 'RV|UI|CJ|RE|RF|AW|AS|NA) %'
I was using:
WHERE SUBSTRING(A.[pa-smart-comment], 1, 5) IN (
'RIRV ', 'RIUI ', 'RIRI ', 'RICJ ', 'RIRE ','RIRF ','RIAW ','RIAS ','RINA '
)
But I find the LIKE
to be faster in use.