Skip to Content
avatar image
Former Member

Sub query in case statement in IDT 4.2

Select T.idperson , CASE WHEN T.type = 'C' THEN (SELECT name from Customers where C.idcustomer = T.idperson)

<code>ELSE
 (SELECT name from Providers where idprovider = T.idperson)
 END Name 
from myTable T 
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Feb 21, 2017 at 12:34 AM

    Select T.idperson , CASE WHEN T.type = 'C' THEN (SELECT name from Customers where C.idcustomer = T.idperson) ELSE (SELECT name from Providers where idprovider = T.idperson) END Name from myTable T

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 21, 2017 at 12:35 AM

    Need solution for this urgently

    Add comment
    10|10000 characters needed characters exceeded