我试图找出CR.DestinationDepot是否有两个记录,然后将它们连接起来(例如):KNI / KHN,而不是它现在如何连接。有任何想法吗?谢谢。
select CR.DestinationCountry,
mm.MovementRef,
CR.DestinationDepot,
case when count(CR.DestinationDepot) >= 2 then 'yes' else 'no' end as [statement],
Case when (CR.DestinationCountry <> 'GB') and count(CR.DestinationDepot) >= 2 then CR.DestinationDepot+'/'+CR.DestinationDepot else CR.DestinationDepot end as [DestinationDepot]
FROM dbo.MALExport AS ME
INNER JOIN dbo.movConLink AS MCL ON ME.ConsignmentReference = MCL.ConsignmentReference
INNER JOIN dbo.cgtRoute AS CR ON CR.RouteID = MCL.CMRRouteID
INNER JOIN dbo.movMovement AS MM ON MM.MovementRef = ME.MovementReference
group by cr.DestinationCountry, cr.DestinationDepot, mm.MovementRef
答案 0 :(得分:0)
以下代码应该是您正在寻找的代码
<div style="word-break: break-all;">
{{vm}}
</div>