sql server - SQL- Ignore case while searching for a string -



i have following data in table
priceordershipped
priceordershippedinbound
priceordershippedoutbound

in sql need write query searches string in table. while searching string should ignore case. below mentioned sql query

select distinct col_name mytable col_name '%priceorder%'  

gives above data, whereas

select distinct col_name mytable col_name '%priceorder%'  

doesn't give.

eg. when search 'priceorder' or 'priceorder' works 'priceorder' or 'priceorder' doesn't work. have tried below query using collate, not working. let me know im going wrong.

select distinct col_name mytable  col_name collate latin1_general_cs '%priceorder%' 

use -

select distinct col_name mytable upper(col_name) upper('%priceorder%') 

or

select distinct col_name mytable lower(col_name) lower('%priceorder%') 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -