(資料圖)
pg 、gp 實(shí)現(xiàn) collect_set 效果:
array_agg(DISTINCT $columnName)) array(SELECT DISTINCT ? $columnName ?from $tableName )
字符串拼接 :
array_to_string(array_agg(DISTINCT ), "|")?
select position("hello" in "test_sql")? output:0 select position("test" in "test_sql")? output:1
故可用position(str_1 in str_2) != 0判斷str_1是否是str_2的子串。
字符串->數(shù)字
to_number(block_id,"999999")和cast(block_id as numeric),但前一句會(huì)限定的數(shù)字大小為10的5次方,即過(guò)大的數(shù)值會(huì)出問(wèn)題,而后一句不會(huì)。
數(shù)字->字符串
cast(block_id as varchar)將數(shù)值型轉(zhuǎn)為字符串型。
以上為個(gè)人經(jīng)驗(yàn),希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。
Copyright © 2015-2022 太平洋產(chǎn)業(yè)網(wǎng)版權(quán)所有 備案號(hào):豫ICP備2022016495號(hào)-17 聯(lián)系郵箱:93 96 74 66 9@qq.com