如何将字符附加到DB2列 [英] how to append a character to DB2 column
本文介绍了如何将字符附加到DB2列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨朋友们,
我需要在select列中向DB2列附加一个字符
Hi friends,
I need to append one character to DB2 column in select Query
SELECT KEY_TMS FROM TCLT_BILL
i需要在选择查询中附加一个字符
假设结果为
abcd
i需要获得 abcd -
i尝试Concat方法不能正常工作
+符号在DB2中不起作用
怎么办?请帮助
i need to append one character to the select query
Suppose the result is
abcd
i need to get as abcd-
i try Concat method its not working
+ symbol is not working in DB2
what to do?. please help
推荐答案
如果
SELECT CONCAT(KEY_TMS, '-') FROM TCLT_BILL;
不起作用然后尝试
SELECT KEY_TMS || '-' FROM TCLT_BILL;
如果这也不起作用那么它可能是用于KEY_TMS的数据类型,请尝试
If that also doesn't work then it may be the datatype used for KEY_TMS, try
SELECT CONCAT(CAST(KEY_TMS AS VARCHAR2(50)), '-') FROM TCLT_BILL;
这篇关于如何将字符附加到DB2列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文