Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Get data from 2 tables into a new table to display a list

Get data from 2 tables into a new table to display a list

Scheduled Pinned Locked Moved C#
databasesql-serversysadminhelptutorial
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nhanlaptrinh
    wrote on last edited by
    #1

    Currently I have 2 tables table A and table B has the same number of columns and data call, absolutely no relationship to each other. (I write in sql server 2005) Example: Table A has 5 rows of data I I Table B has 10 rows of data Now you will create a table C has the same number of columns and data types as table A and Group B Group C I want to get data from 2 tables A and B. And Group C would be 15 rows of data. You do know or did help me through. Thanks in advance home.

    B 1 Reply Last reply
    0
    • N nhanlaptrinh

      Currently I have 2 tables table A and table B has the same number of columns and data call, absolutely no relationship to each other. (I write in sql server 2005) Example: Table A has 5 rows of data I I Table B has 10 rows of data Now you will create a table C has the same number of columns and data types as table A and Group B Group C I want to get data from 2 tables A and B. And Group C would be 15 rows of data. You do know or did help me through. Thanks in advance home.

      B Offline
      B Offline
      Blue_Boy
      wrote on last edited by
      #2

      use union all

      select a.Column1,a.Column2 from TableA a
      union all
      select b.Column1,b.Column2 from TableB b


      I Love T-SQL "VB.NET is developed with C#.NET" If my post helps you kindly save my time by voting my post.

      N 1 Reply Last reply
      0
      • B Blue_Boy

        use union all

        select a.Column1,a.Column2 from TableA a
        union all
        select b.Column1,b.Column2 from TableB b


        I Love T-SQL "VB.NET is developed with C#.NET" If my post helps you kindly save my time by voting my post.

        N Offline
        N Offline
        nhanlaptrinh
        wrote on last edited by
        #3

        Thank you very much.:thumbsup:

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups