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
 Comparison

Author  Topic 

immad
Posting Yak Master

230 Posts

Posted - 2013-09-13 : 02:52:47
hello,

how i can make a comparison of data.


sqlid----foxid
1--------4
2--------3
3--------2

i want this type of data

sqlid----foxid-----id
1--------4--------2
2--------3--------3
3--------2--------

please help me out


immad uddin ahmed

bandi
Master Smack Fu Yak Hacker

2242 Posts

Posted - 2013-09-13 : 03:04:43
What is the logic here? Can you explain the logic for the above output?

--
Chandu
Go to Top of Page

immad
Posting Yak Master

230 Posts

Posted - 2013-09-13 : 04:00:30
if sqlid columns value and foxid columns value match then its shows in id column

immad uddin ahmed
Go to Top of Page

divya.ce
Starting Member

16 Posts

Posted - 2013-09-13 : 06:30:49
What value is to be shown in ID column? please give complete In and out description, In the output which you have shown, sqlid and foxid do not match, then also you are showing id column value.
Go to Top of Page

VeeranjaneyuluAnnapureddy
Posting Yak Master

169 Posts

Posted - 2013-09-13 : 06:49:53
SELECT DISTINCT T.SqlId FROM Temp AS T
inner join Temp TT
ON T.SqlId = TT.FoxId
ORDER BY t.SqlId

veeranjaneyulu
Go to Top of Page
   

- Advertisement -