Delphi 判断SQL数据库某字段的值大于0 或不为NULL时,执行对数据库的UPDATA
Delphi判断SQL数据库某字段的值大于0或不为NULL时,执行对数据库的UPDATA就是怎样在Select*fromUserBasicInfowhere(Bedcha...
Delphi 判断SQL数据库某字段的值大于0 或不为NULL时,执行对数据库的UPDATA
就是 怎样在 Select * from UserBasicInfo where (BedchamberId > 0 and BedchamberId is NUll) 的情况下 才 执行
'Update UserBasicInfo set UserName=Rtrim(t1.UserName), GenderId=t1.Gender, ExtUserId=t1.ExtUserId, CardId=case when UserType<>3 or UserType is null then t1.CardId else t2.CardId end, CridentialId=t1.CridentialId, ExpiredTime=t1.ExpiredTime,IdentityNO=t1.IdentityNo,EmployeeType=t3.Id ,EmpDeptId=t4.Id ,WorkPosition=t1.PositionId from UserBasicInfo t2 left join temInputUser t1 on t1.CridentialId=t2.CridentialId left join Dict_EmployeeType t3 on t1.EmployeeType=t3.Name left join DeptBranch t4 on t1.DeptName=t4.Name where t2.CridentialId in (select CridentialId from temInputUser) , '
如果 BedchamberId 为空 就不进行更新
这个判断具体要怎么写啊?求指点啊 谢谢 展开
就是 怎样在 Select * from UserBasicInfo where (BedchamberId > 0 and BedchamberId is NUll) 的情况下 才 执行
'Update UserBasicInfo set UserName=Rtrim(t1.UserName), GenderId=t1.Gender, ExtUserId=t1.ExtUserId, CardId=case when UserType<>3 or UserType is null then t1.CardId else t2.CardId end, CridentialId=t1.CridentialId, ExpiredTime=t1.ExpiredTime,IdentityNO=t1.IdentityNo,EmployeeType=t3.Id ,EmpDeptId=t4.Id ,WorkPosition=t1.PositionId from UserBasicInfo t2 left join temInputUser t1 on t1.CridentialId=t2.CridentialId left join Dict_EmployeeType t3 on t1.EmployeeType=t3.Name left join DeptBranch t4 on t1.DeptName=t4.Name where t2.CridentialId in (select CridentialId from temInputUser) , '
如果 BedchamberId 为空 就不进行更新
这个判断具体要怎么写啊?求指点啊 谢谢 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询