Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Distributed Query


Distributed Query

Author
Message
Minnu
Minnu
Old Hand
Old Hand (305 reputation)Old Hand (305 reputation)Old Hand (305 reputation)Old Hand (305 reputation)Old Hand (305 reputation)Old Hand (305 reputation)Old Hand (305 reputation)Old Hand (305 reputation)

Group: General Forum Members
Points: 305 Visits: 950
Hi Team,

i have two tables, i want a query to retrieve records available in (Instance 1) Table : A and missing in (Instance 2) Table :B.

Table_1:       ID | CHARACTER
    1   A
    2   B
    3   C
    4   D
    5   E
      
Tabe_2 :    ID | CHARACTER
    1   B
    2   D
    3   C

Output should be :
1 A
2 B
4 D
5 E


select * from Table_1 T1
LEFT join [SHH05\SVR1].Students.dbo.Stud_info T2
ON T1.ID=T2.ID

but am not getting the exact result, can u please help me...
Stuart Davies
Stuart Davies
SSCarpal Tunnel
SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)

Group: General Forum Members
Points: 4451 Visits: 4538
See http://www.sqlservercentral.com/Forums/Topic1433051-391-1.aspx#bm1433101 for suggestions

-------------------------------
Posting Data Etiquette - Jeff Moden
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
Bhuvnesh
Bhuvnesh
SSCrazy
SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)

Group: General Forum Members
Points: 2924 Visits: 4076
Minnu (3/21/2013)
Table_1:       ID | CHARACTER
    1   A
    2   B
    3   C
    4   D
    5   E
      
Tabe_2 :    ID | CHARACTER
    1   B
    2   D
    3   C

Output should be :
1 A
2 B
4 D
5 E

On what basis you are avoiding "C" OR how results comes here . what to include and what to exclude in results . Please clarify.

-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done;-)
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search