RSS Forums RSS

Compare 2 tables

Please support our MS SQL advertiser: Programming Forums
Reply
Posts: 1
Reputation: Cheluvaraj is an unknown quantity at this point 
Solved Threads: 0
Cheluvaraj Cheluvaraj is offline Offline
Newbie Poster

Compare 2 tables

  #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, 1 views)
AddThis Social Bookmark Button
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.



Views: 623 | Replies: 0 | Currently Viewing: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 2:37 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC