--如以下腳本,最后目的想得到 emp_1=1 and staff_2=2
do language plpgsql
$$
declare var_s varchar ='@emp=1 and @staff=2' ;
begin
with key_value as (
select '@emp' as key_ ,'emp_1' as value_
union
select '@staff', 'staff_2' as value_
)
select replace(var_s,key_ ,value_) into var_s
from key_value ;
raise notice '%', var_s ; --只得到 emp_1=1 and @staff=2
end
$$
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/189653.html
標籤:PostgreSQL
上一篇:抽樣中的題,這……該怎么做?
下一篇:資料表如何添加id
