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
 Fetche mis matched Records from two tables

Author  Topic 

silvestersymon
Starting Member

2 Posts

Posted - 2013-11-08 : 02:05:46
Hi All,

Hi have 'Privious' table as

***Metrics Count***
AccessibilityFilter 1679
Archives 80
Corel 90
DateFilter 1680

and 'Current' table as

***Metrics Count***
AccessibilityFilter 1679
Archives 85
Corel 100
DateFilter 1680


I want to fetch only the mis matched records as below.

***Metrics PreviousCount CurrentCount***
Archives 80 85
Corel 90 100

Thanks In Advance...

Regards,
Simon.L

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-11-08 : 04:00:19
[code]
SELECT c.TextField,c.NumberField,p.NumberField
FROM Current c
INNER JOIN Previous p
ON p.TextField = c.TextField
WHERE p.NumberField <> c.NumberField
[/code]

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

silvestersymon
Starting Member

2 Posts

Posted - 2013-11-11 : 04:16:24
Hi Visakh

Its working really fine thank you.

Regards,
Simon.L
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-11-11 : 04:33:45
you're welcome

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -