USEGEAR

导航

2023年2月18日 #

PG把多条记录合并成字符串,用逗号分隔

摘要: select array_to_string( array(select quote_literal("HD_Code") from "public"."Hosp_Dept" where "HD_Code" in ('103001','103002','103') and "HD_SFMJ" is 阅读全文

posted @ 2023-02-18 18:00 USEGEAR 阅读(259) 评论(0) 推荐(0) 编辑

sqlite把多条记录合并成字符串,用逗号分隔

摘要: select group_concat(hdcd_DeptName) from f1 where hdcd_DeptName='呼吸内科门诊' 我们需要把多条记录 合并成字符串,用逗号分隔。这样的需求,目的是用于SQL语句和JSON处理。 对于SQLite用函数group_concat SELECT 阅读全文

posted @ 2023-02-18 09:29 USEGEAR 阅读(800) 评论(0) 推荐(0) 编辑