所以我基本上想显示这个(整行在一列)。
我喜欢[类型栏]蛋糕和[糖衣栏]以及[水果栏]。
结果应该是。
Cake_Column
----------------
I like chocolate cake with whipped_cream and a cherry.
I like strawberry cake with vanilla_cream and a lemon_slice.
etc.
etc.
我需要某种TO_CHAR语句来完成([column] "some text" [column])"new_column_name"。
我应该知道什么?
在Oracle中,你有两个选择来连接字符串。
CONCAT的例子。
CONCAT(
CONCAT(
CONCAT(
CONCAT(
CONCAT('I like ', t.type_desc_column),
' cake with '),
t.icing_desc_column),
' and a '),
t.fruit_desc_column)
使用||
的例子。
'I like ' || t.type_desc_column || ' cake with ' || t.icing_desc_column || ' and a ' || t.fruit_desc_column
你试过||
操作符吗?