Compare 2 tables

Please support our MS SQL advertiser: Intel Parallel Studio Home
Reply

Join Date: Oct 2008
Posts: 1
Reputation: Cheluvaraj is an unknown quantity at this point 
Solved Threads: 0
Cheluvaraj Cheluvaraj is offline Offline
Newbie Poster

Compare 2 tables

 
0
  #1
Oct 1st, 2008
Below query for comparing 2 tables and extract the uncommon like GUID X121 doesn’t exists in the 2nd table and the GUID which are unsuccessful (has –ve values).
select isnull(pt.GUID,Wo.GUIS)as GUID,
pt.[ErrorNo] as Error
from PieTreace pt
full outer join WorkMessage Wm
on pt.GUID = Wm.GUID
where(pt.GUId is null) or (pt.[ErrorNo]<0)
Along with above query I want to extract those,ErroNo and GUID which are unsuccessful for first time and next time(It may be second time or third time)it’s successful, with the lastest date.(I have marked those repeating GUID with red colour.)

Thanks.
Attached Files
File Type: doc Tables.doc (35.0 KB, 3 views)
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC