User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MS SQL section within the Web Development category of DaniWeb, a massive community of 422,391 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,834 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MS SQL advertiser: Programming Forums
Views: 626 | Replies: 3 | Solved
Reply
Join Date: Sep 2007
Posts: 13
Reputation: bhakti.thakkar is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
bhakti.thakkar bhakti.thakkar is offline Offline
Newbie Poster

help in performing join

  #1  
Mar 13th, 2008
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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Nov 2007
Location: � Jogja �
Posts: 2,584
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Rep Power: 11
Solved Threads: 235
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: help in performing join

  #2  
Mar 14th, 2008
  1. 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
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
Reply With Quote  
Join Date: Mar 2008
Posts: 1
Reputation: ee_rlee is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
ee_rlee ee_rlee is offline Offline
Newbie Poster

Re: help in performing join

  #3  
Mar 23rd, 2008
hi, you need to use union

SELECT ID, COL1 FROM Table1
UNION
SELECT ID, COL1 FROM Table2
Reply With Quote  
Join Date: Sep 2007
Posts: 13
Reputation: bhakti.thakkar is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
bhakti.thakkar bhakti.thakkar is offline Offline
Newbie Poster

Re: help in performing join

  #4  
Mar 24th, 2008
Originally Posted by ee_rlee View Post
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
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb MS SQL Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the MS SQL Forum

All times are GMT -4. The time now is 8:57 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC