I have the following data in a table
PriceOrderShipped
PriceOrderShippedInbound
PriceOrderShippedOutbound
In SQL, I need to write a query that looks for a row in a table. When searching for a string, it must ignore case. For the SQL query below
SELECT DISTINCT COL_NAME FROM myTable WHERE COL_NAME LIKE '%PriceOrder%'
gives all of the above data, whereas
SELECT DISTINCT COL_NAME FROM myTable WHERE COL_NAME LIKE '%PriceOrder%'
does not give.
Eg. when I search for "PriceOrder" or "priceOrder", it works, but "priceorder" or "Priceorder" does not work. I tried using the following query using COLLATE, but it does not work. Let me know where I am going wrong.
SELECT DISTINCT COL_NAME FROM myTable WHERE COL_NAME COLLATE latin1_general_cs LIKE '%Priceorder%'
sql sql-server case-insensitive sql-like ignore-case
shockwave Apr 18 '13 at 12:09 on 2013-04-18 12:09
source share