The following where clause returns data not wanted.
My sample data should have returned one row but instead it returned all rows whether it had an underscore or a blank.
sample data looked like this
12 records had the following "Lamp Inc." in <Column1>
one of the 12 records contained "Lamp_I" in <Column2>
How can I prevent returning records that are not like the criteria submitted when an underscore is included?
Code:
select * from <someTable> where <Column1> like "%Lamp_I%" or <Column2> like "%Lamp_I%"
sample data looked like this
12 records had the following "Lamp Inc." in <Column1>
one of the 12 records contained "Lamp_I" in <Column2>
How can I prevent returning records that are not like the criteria submitted when an underscore is included?
Comment