如何比较区分大小写的字符串

时间:2019-06-25 14:07:58

标签: sql amazon-redshift case-sensitive

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

我遇到错误:SQL错误[500310] [42601]:Amazon无效操作:“ COLLATE”或附近的语法错误 位置:239;

1 个答案:

答案 0 :(得分:0)

默认值应为区分大小写,如documentation中所述:

path like '%login%' 

不区分大小写,请使用ilike

path ilike '%login%'