當我執行我的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) –