gpt4 book ai didi

sql - 将值提取到 postgresql 中的逗号分隔字符串中

转载 作者:行者123 更新时间:2023-11-29 12:29:54 27 4
gpt4 key购买 nike

<分区>

这应该很简单。像这样的查询

SELECT code_id FROM code WHERE status = 1

通常给出这样的结果

code_id
10
11
12

但我的目标是提取到一个字符串中

10,11,12

为了在其他查询中使用它

SELECT x FROM table WHERE status in (10,12,13)

最好在同一个查询中。在不添加额外扩展的情况下使用“标准”Postgresql 是否可行?

到目前为止,一切都在使用标准不可用的扩展。

提前致谢。

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com