Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Compare Results

Author  Topic 

MxWebb
Starting Member

8 Posts

Posted - 2007-01-30 : 10:50:26
Ok need some help here.

What I am doing is trying to add something to my sql statement that will show records that don't match..
Here is what I am looking at.

Rec1 Rec2
DAL02 1 DAL02 9
DAL03 2 DAL03 10
DAL05 4 DAL05 11

So what I want
is to select all the rows but either creates field that show me which Records don't match on Second field or some flag so I don't have to visual go throw and find them. Yes I can actualy write the Sql so it only pulls back the records that match on both fields but I need a way so you can look and Really see that result are true.


Hope this makes sence..

Select #Temp1.org_acronym, #Temp1.Maxcount, #Temp2.org_acronym, #Temp2.Maxcount
From #Temp1, #Temp2
Where #Temp1.org_acronym = #Temp2.org_acronym



Thanks
Michael Webb

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-01-30 : 10:52:47
[code]

Select #Temp1.org_acronym, #Temp1.Maxcount, #Temp2.org_acronym, #Temp2.Maxcount
From #Temp1 inner join #Temp2
On #Temp1.org_acronym = #Temp2.org_acronym
where #Temp1.Maxcount <> #Temp2.Maxcount
[/code]


KH

Go to Top of Page
   

- Advertisement -