sql - How to search multiple columns with one variable -


i want search 1 table, , multiple columns using 1 variable. code looks this:

select        lcustomerid, slastname, sfirstname, saddress1, saddress2,    scity, sstate, szipcode , @search expr1            customers (slastname = n'includes @search')  or    (sfirstname = n'includes @search')  ,   (sbarcode = n'includes @search') 

i want include string not =

assuming meant have ors, , "i want include string" means want partial match (e.g. search "john" yields "johnson" , "rojohn"), looking keyword:

where slastname  n'%' + @search + '%'    or sfirstname n'%' + @search + '%'    or sbarcode   n'%' + @search + '%'; 

Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -