![](/img/trans.png)
[英]Extract from string before last instance of a character - BigQuery
[英]BQ function to transform caron character from a string to character without caron
我試圖擺脫卡隆字符 (č、ć、š、ž) 並將它們轉換為 c、c、s、z:
with my_table as (
select 'abcčd sštuv' caron, 'abccd sstuv' no_caron union all
select 'uvzž', 'uvzz' union all
select 'ijkl cČd', 'ijkl cCd' union ALL
select 'Ćdef', 'Cdef'
)
SELECT *
FROM my_table
我試圖擺脫他們
SELECT *,
regexp_replace(caron, r'š', 's') as no_caron
FROM my_table
但我認為這是低效的。 我知道有一個選項可以按照此處所述在 function 上寫信,但我不知道如何在我的案例中使用它。
提前致謝!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.