gpt4 book ai didi

sql - DB2:合并 3 列输出的函数

转载 作者:行者123 更新时间:2023-12-04 02:50:26 25 4
gpt4 key购买 nike

我在表1中有以下记录

c1  c2  c3
----------
A B C

如何合并 c1 c2 和 c3 以便输出

乙丙
输出之间有空格
我使用了 concat 函数,但它不带 3 个参数
喜欢
select concat (c1,c2,c3) from table1

我跑不动 select * from table1因为我想在一列中输出

最佳答案

这至少适用于 z/OS 版本:

select c1 concat ' ' concat c2 concat ' ' concat c3

了解 DB2 documentation

关于sql - DB2:合并 3 列输出的函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15251909/

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