Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Distributed Query Expand / Collapse
Author
Message
Posted Thursday, March 21, 2013 4:08 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Today @ 8:02 AM
Points: 227, Visits: 714
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...
Post #1433689
Posted Thursday, March 21, 2013 4:17 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Today @ 12:37 AM
Points: 3,035, Visits: 3,237
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
Post #1433699
Posted Thursday, March 21, 2013 5:19 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Tuesday, August 19, 2014 12:26 AM
Points: 2,840, Visits: 3,963
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
Post #1433726
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse