我就废话不多说了,大家还是直接看代码吧~with person_name as (select c.id,array_to_string(array_agg(distinct p.c_name), ' , ') as p_namefrom biz_notification_config c join biz_notification_person p on p.id = any (string_to_array(c.p..
今天写sql的时候,发现PG里有一张表的面积字段竟然设置成字符串类型,这样就不能统计使用sum函数了,所以需要将字符串转换成double类型再相加。select sum(to_number(mj,9999.99)) as amountmjfrom table group by area其中9999.99就是不管是mj字段..