Nested CASE expressions

304
May 02, 2017, at 07:52 AM
When APPROVALSTATUS='9' then 
        case
         when exists (select * from USERINFO where
          userinfo.NETWORKALIAS = trvexptable.MS_IT_FINALAPPROVER
            and userinfo.enable=0)
            then 'Inactive Approver'
            else
            then 
             CASE
                WHEN TRVEXPTABLE.MS_IT_RECEIPTSRECEIVED=0 AND TRVPARAMETERS.MS_IT_RECEIPTMETHODS=0 THEN 'RECEIPTS PENDING'
                WHEN TRVEXPTABLE.MS_IT_RECEIPTSRECEIVED=0 AND TRVPARAMETERS.MS_IT_RECEIPTMETHODS=1 THEN 'In review' 
                WHEN TRVEXPTABLE.MS_IT_RECEIPTSRECEIVED=1 AND TRVPARAMETERS.MS_IT_RECEIPTMETHODS=1 THEN 'In review' 
                WHEN TRVEXPTABLE.MS_IT_RECEIPTSRECEIVED=1 AND TRVPARAMETERS.MS_IT_RECEIPTMETHODS=0 THEN 'In review' 
                end     
            END
  END AS 'ApprovalStatus'

I am writing a case where all the outputs should be showed for inactive users receipts pending in review

the above syntax is wrong. Can anyone help with syntax? please

Rent Charter Buses Company
READ ALSO
How can I select a table that have 2 part name(Mysql?

How can I select a table that have 2 part name(Mysql?

I know this question is a little stupidBut I will appreciate to answer it, I have a table, The table have 2 part name

188
#1093 - Table is specified twice, both as a target for 'UPDATE' and as a separate source for data

#1093 - Table is specified twice, both as a target for 'UPDATE' and as a separate source for data

I tried to update a field with multiplication and it shows error #1093 - Table is specified twice, both as a target for 'UPDATE' and as a separate source for data

852
docker phpmyadmin cant access localhost

docker phpmyadmin cant access localhost

I try to create a phpmyadmin docker, the command executed successfully but when i access to localhost:8080 it freezes and nothing appears

583
how to convert sql query to relational algebra [on hold]

how to convert sql query to relational algebra [on hold]

I need some help converting an SQL query into relational algebra

329