Skip to Content
0

Sub query in case statement in IDT 4.2

Feb 21, 2017 at 12:32 AM

87

avatar image
Former Member

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 
idt
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

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

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

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Feb 21, 2017 at 12:35 AM
0

Need solution for this urgently

Share
10 |10000 characters needed characters left characters exceeded