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!

need sql query to get the data from two table reg..

Discussion in 'SQL PL/SQL' started by laxman, Jul 13, 2010.

  1. laxman

    laxman Forum Expert

    Messages:
    144
    Likes Received:
    0
    Trophy Points:
    230
    Location:
    MUMBAI
    Hi all,
    I think i need to precise my doubt in more easy way since i didnt get any responce of my last post.
    anyway with few sample data and small scenario i hope i may get some help from u all guys.

    here is table description.

    sql> select * from req;

    requestid topicdesc subtopicdesc
    ---------- ----------- ---------------
    1111 topic subtopic3

    sql> select * from req_hist;
    requestid topicdesc subtopicdesc
    ---------- ---------- ---------------
    1111 topic subtopic1
    1111 topic subtopic2

    i want the output like this ????
    requestid topicdesc subtopicdesc
    ---------- ----------- ---------------
    1111 topic subtopic1
    1111 topic subtopic2
    1111 topic subtopic3

    i am unable to create a query which gives this desired result.

    Can anybody help me out.

    Thanks n regards
    Laxman
     
  2. rajavu

    rajavu Forum Guru

    Messages:
    815
    Likes Received:
    52
    Trophy Points:
    610
    Location:
    @ Bangalore , India
    Have you tried ?

    Code (SQL):
    SELECT * FROM REQ
    UNION
    SELECT * FROM REQ_HIST;