SELECT ITEMGROUPID ,
ITEMID ,
ITEMNAME ,
ITEMTYPE ,
COSTGROUPID ,
SALESMODEL ,
DIMENSION ,
( SELECT DESCRIPTION
FROM DIMENSIONS
WHERE ( NUM = 0 )
AND ( DIMENSIONCODE = IT1.DIMENSION )
) AS Expr1
FROM INVENTTABLE AS IT1
WHERE ( DATAAREAID = 'm02' )
AND ( ITEMGROUPID = 'FG' )
AND ( ITEMID = '14901C' )
此查询引发错误。结果应该是它int
从列中获取值()IT1.DIMENSION
并搜索表并从表中的描述列中Dimension
返回值( ) 。nvarchar
DIMENSIONS
执行后出现以下错误:
转换失败。将 NVARCHAR 值“AG”转换为数据类型 INT 时。
此处的目标是消除在上述两个表INVENTTABLE
和DIMENSIONS
.