答案 0 :(得分:2)
您不需要LISTAGG
,只需要连接字符串:
Oracle查询:
SELECT contractorno,
fruits || stock_type || stockno AS stockinfo
FROM (
SELECT contractorno,
fruits,
stock_type,
stockno
FROM your_query
)
在SQL Server中,字符串连接运算符为+
而不是Oracle ||
。
答案 1 :(得分:1)
<强>的Oracle 强>
SELECT contractorno
,fruits || '-' || stock_type || '-' || stockno AS stockinfo
FROM (
--your query--
)q
<强> SQL-服务器强>
SELECT contractorno,
Concat (fruits, '-', stock_type, '-', stockno) AS stockinfo
FROM (--yourquery--
) q