参考资料
with cte as(
select f1,f2,array_same(f1,f2) as same from (select array[1,2,3] as f1,array[3] as f2) tmp
)select coalesce(array_length(same,1)::float8,0)/(array_length(f1,1)::float8),* from cte
参考资料
with cte as(
select f1,f2,array_same(f1,f2) as same from (select array[1,2,3] as f1,array[3] as f2) tmp
)select coalesce(array_length(same,1)::float8,0)/(array_length(f1,1)::float8),* from cte