当我执行我的Transact SQL代码IF使用Transact SQL语句
IF (SELECT model_id FROM request_unit where request_id = '4357') IS NULL
SELECT part_id FROM request_unit WHERE request_id = '4357'
ELSE
SELECT model_id FROM request_unit where request_id = '4357'
我收到以下错误:
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
它很好用,谢谢,但结果表的标题没有显示列的名称(model_id或part_id)。它显示'没有列名' – Ces1919
@NaderLaroussi只是别名,就像(model_id ModelID,part_id PartID) –