我想根據條件將數據插入到一列中。在插入查詢條件中選擇一列
DECLARE @section NVARCHAR(40)
SET @section ='section1'
INSERT [table]
(
Class_Of_Business,
Financial_Status,
Source_Of_Funds,
Source_Of_Wealth,
SELECT CASE
WHEN @Section = 'section1' THEN 'Section_1_Operator_Comments'
WHEN @Section = 'section2' THEN 'Section_2_Operator_Comments'
ELSE 'Section_3_Operator_Comments' END
)
VALUES ('Private','Good','bank','Business','section comments')
基於用戶輸入
註釋(SECTION1,第2節或SECTION3)
需要在各列中插入。
爲您的DBMS添加標記。也許Sql Server? –