hi all,

Table 1:

ID | COL1
1 | 1
1 | 13
1 | 64

Table 2:

ID | COL1
1 | 14
1 | 13


Output needed:

ID | COl

1 | 1
1 | 13
1 | 14
1 | 64

How will i accomplish this???

Thanks and regards
Bhakti

select a.id, a.colname, b.colname from Table1 a join Table2 a on (a.id=b.id) where a.id = '1' order by a.id asc
commented: thanks +1

hi, you need to use union

SELECT ID, COL1 FROM Table1
UNION
SELECT ID, COL1 FROM Table2

hi, you need to use union

SELECT ID, COL1 FROM Table1
UNION
SELECT ID, COL1 FROM Table2

hi,
thanks for your help. UNION Clause helped me to get the desired result

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.