rows Issu

  • Hello Team,

    I have 2 Tables A and Tables B.In Table A i have 3 rows(1,2,3) and Table B i have 3 rows(4,5,6).I need to get all the rows but i need to have single cloumn.Please advise

    Thanks in advance

     

    RK

     

     

     

  • Would you kindly post what you have tried so far along with sample data and table structure? Knowing exactly what is required will help us to help you. ??

    -------------------------------Posting Data Etiquette - Jeff Moden [/url]Smart way to ask a question
    There are naive questions, tedious questions, ill-phrased questions, questions put after inadequate self-criticism. But every question is a cry to understand (the world). There is no such thing as a dumb question. ― Carl Sagan
    I would never join a club that would allow me as a member - Groucho Marx

  • UNION will be your friend there as long as the tables have the same number of columns OR you can add fake data into the missing columns.

     

    In your example, I'm going to assume that both tables containing those numbers are called "ID", so you'd write:

    SELECT ID
    FROM A
    UNION ALL
    SELECT ID
    FROM B

    UNION ALL will give you all results, UNION will give you a distinct list.

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.

  • Thanks

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply