我无法获取此TRIM代码

SELECT
   dbo.COL_V_Cost_GEMS_Detail.TNG_SYS_NR AS [EHP Code],
   dbo.COL_TBL_VCOURSE.TNG_NA AS [Course Title],
   LTRIM(RTRIM(FCT_TYP_CD)& ') AND (' & LTRIM(RTRIM(DEP_TYP_ID) & ')' AS [Course Owner]

最佳答案

您缺少两个右括号...并且我不确定&符是否可以用作字符串连接运算符。尝试“+”

SELECT dbo.COL_V_Cost_GEMS_Detail.TNG_SYS_NR AS [EHP Code],
dbo.COL_TBL_VCOURSE.TNG_NA AS [Course Title],
LTRIM(RTRIM(FCT_TYP_CD)) + ') AND (' + LTRIM(RTRIM(DEP_TYP_ID)) + ')' AS [Course Owner]

关于sql - 如何在SQL Server中使用TRIM函数,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/14447350/

10-13 01:05