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

Find difference between two data sets Expand / Collapse
Author
Message
Posted Thursday, March 21, 2013 3:16 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Tuesday, February 18, 2014 5:22 PM
Points: 58, Visits: 197
Hello everyone.

I have a query that I made on the database the output of which is say for example

Id
1
2
3
4
5

I then made changes to the Database.
I ran the same query . This time I get

Id
1
3
5

I would like to know if there is a way of finding the missing Id's in the second query.
My query outputs more than 11000 rows.

Thanks
L&P





Post #1434051
Posted Thursday, March 21, 2013 3:18 PM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 1:42 AM
Points: 20,799, Visits: 32,717
Look at the EXCEPT operator. You need to be able to generate both results sets in order to compare them.



Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Post #1434052
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse