case in sql stored procedure on SQL Server

前端 未结 3 1105
谎友^
谎友^ 2021-02-19 01:39

Based on a parameter I\'d like to execute a different Update in my stored procedure. I\'ve tried many permutations of the code below, but I always have errors.

         


        
3条回答
  •  一向
    一向 (楼主)
    2021-02-19 02:13

    (SELECT CASE WHEN (SELECT  Salary FROM tbl_Salary WHERE Code=102 AND Month=1 AND Year=2020 )=0 THEN 'Pending'
    WHEN (SELECT  Salary FROM tbl_Salary WHERE Code=102 AND Month=1 AND Year=2020 AND )<>0 THEN (SELECT CASE  WHEN ISNULL(ChequeNo,0) IS NOT NULL   THEN 'Deposit' ELSE 'Pending' END AS Deposite FROM tbl_EEsi WHERE  AND (Month= 1) AND (Year = 2020) AND )END AS Stat)
    

提交回复
热议问题