insert語句加入條件判斷怎么寫?
---不知道你說的是哪種情況,我理解的有2種,1是對插入源進行過濾,2是對插入的某些值作判斷,是某個特定值時轉換成另一個值--情況1:使用Insert Into Select語法實現--通過拼接結果集作為Select數據源之后可以加Where條件Insert Into YourTable (id,name,status,remark)Select id,name,status,remark From (Select 1 as id,'張三' as name,'在職' as status,'沒有備注' as remark Union Select 2,'李四','離職','') as s Where id>2 And id