select CASE when (select distinct BR.BorrowerID from tblBorrow BR
inner join tblWorker W on W.ContractorID=BR.BorrowerID
inner join tblBorrowWorker TWB on TWB.WorkerID=W.WorkerID
inner join tblBorrowWorkerAssign TBWA on TWB.BorrowWorkerAssignmentID=TBWA.BorrowWorkerAssignmentID where TWB.WorkerID=11276) then 'BR.BorrowerID' else 'NotBorrowed' end as BorrowedStatus
这里实际上在'Then'条件下我想显示BorrowerID,这里的子查询部分运行良好并返回ID,但是当我添加CASE语句时,它给出一个错误“在上下文中指定的非布尔类型的表达式条件是预期的,在'then'附近。“这个查询是我的存储过程的一部分。解决方案是什么