-2
你好人我有一個問題,關於多個值的串聯進入單列,用逗號分隔,如下所示。如何連接sql中的多個值
例如有一個報表正在提取數據,但對於一列有5個值,因爲對於所有列重複5次相同的行,所以我想連接該特定列的所有5個值。
請讓我知道我該怎麼做。下面的 是提取5個值的查詢,我希望這些值只能用逗號分隔。
SELECT PAC.PACKAGED_ITEM_GID
FROM SHIPMENT SH, ORDER_MOVEMENT OM,
ORDER_MOVEMENT_D OMD, S_SHIP_UNIT SSU, S_SHIP_UNIT_LINE SUL,
PACKAGED_ITEM PAC
WHERE OM.SHIPMENT_GID = SH.SHIPMENT_GID
AND OM.ORDER_MOVEMENT_GID = OMD.ORDER_MOVEMENT_GID
AND OMD.S_SHIP_UNIT_GID = SSU.S_SHIP_UNIT_GID
AND SSU.S_SHIP_UNIT_GID=SUL.S_SHIP_UNIT_GID
AND SUL.PACKAGED_ITEM_GID = PAC.PACKAGED_ITEM_GID
AND SH.SHIPMENT_GID = 'ULA/SAO.5000070143'
'SELECT PAC.PACKAGED_ITEM_GID從發貨SH,ORDER_MOVEMENT OM,ORDER_MOVEMENT_D OMD,S_SHIP_UNIT SSU,S_SHIP_UNIT_LINE SUL,PACKAGED_ITEM PAC WHERE OM.SHIPMENT_GID = SH.SHIPMENT_GID AND \t OM.ORDER_MOVEMENT_GID = OMD.ORDER_MOVEMENT_GID AND OMD.S_SHIP_UNIT_GID = SSU.S_SHIP_UNIT_GID AND SSU.S_SHIP_UNIT_GID = SUL.S_SHIP_UNIT_GID AND SUL.PACKAGED_ITEM_GID = PAC.PACKAGED_ITEM_GID AND SH.SHIPMENT_GID = 'ULA/SAO.5000070143' –
提供樣品數據,期望的結果,並且查詢你在問題文本中使用*。 –
感謝您查看它,但我明白了:) –