1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

SQL Query

Discussion in 'SQL PL/SQL' started by nandhu, Jul 19, 2010.

  1. nandhu

    nandhu Active Member

    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    55
    The following is the question:

    QRY 1: I have a table "A". Data is selected from table A based on some condition.

    Then , Based on a value of "field1" coulmn got from QRY1, two more valus need to be fetched from either tableB or tableC as follows:

    if (field1==0)
    fetch two column values from tableB
    else
    fetch two column values from tableC


    Could someone help me out in what joins needs to be used then how to select the corresponding table based on the QRY1's output column "field1"


    Thanks in advance for your help...
     
  2. rajavu

    rajavu Forum Guru

    Messages:
    815
    Likes Received:
    52
    Trophy Points:
    610
    Location:
    @ Bangalore , India
    Might be you can try CASE in your queries (In Selelct List)

    CASE WHEN END