Skip to content
Advertisement

How to do like compare on case sensitive string

select http_host,user_agent,date,path, count(*)
FROM "public"."bus_request" 
where app_name = 'yyyy' and event_type <> 'browser_js' 
    and date <= GETDATE() and date>= GETDATE()-14 and request_score <> '80' 
    and path  '%login%' COLLATE SQL_Latin1_General_Cp1_CS_AS

group by http_host,path, date, user_agent
order by http_host,date,count desc

I am getting error: SQL Error [500310] [42601]: Amazon Invalid operation: syntax error at or near “COLLATE” Position: 239;

Advertisement

Answer

The default should be case sensitive, as explained in the documentation:

path like '%login%' 

For case-insensitive, use ilike:

path ilike '%login%' 
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement