Click here to Skip to main content
15,899,474 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am having two tables (Tabel 1,Tabel2)
Table 1(After selct statement of the table i am getting these two below columns)
XML
Column1|column2|
xx     |yy     |
zz     |AA     |
BB     |cc     |

Tabel 2(After selct statement of the table i am getting these two below columns)
<pre lang="xml">Column1|Column2|
DD     |FF     |
GG     |HH     |

i need the combination of two tables should be like below
Table 3

&lt;pre lang=&quot;vb&quot;&gt;Column !|Column 2|
xx     |yy     |
zz     |AA     |
BB     |cc     |
DD     |FF     |
GG     |HH     |&lt;/pre&gt;</pre>
Posted
Comments
ntitish 1-Jul-13 5:31am    
Tabel 1,Tabel 2 not having same columns they are different.......then how to union the two tabels...

You can use SQL: UNION ALL[^] to do the same. Try this:
SQL
SELECT Column1, Column2 FROM Table1
UNION ALL
SELECT YourCol1 AS Column1, YourCol2 AS Column2 FROM Table2


--Amit
 
Share this answer
 
v2
Use union as shown below

SQL
Select column1,column2 from table1 [where CONDITION]
UNION ALL
Select column1,column2 from table2 [where CONDITION]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900