4 Replies Latest reply: Mar 4, 2013 6:10 AM by Arun Paladugu RSS

    How to write a subquery with "if else" condition

      Hi friends,

       

      I have the following SQL query:

      select

      case when (select id from table1 where id=number) is null then 'Not Exists'

               else 'Exists'

      END case,

      number,name from table2;

       

      I have created 2 QVD files with table1.qvd and table2.qvd.

       

      I knew only this:

      Load number,

              name

      FROM

      [C:\Documents and Settings\Desktop\QV_QVD\table2.qvd]

      (qvd);

       

      Any help is greatly appreciated.