dbTalk Databases Forums  

comparing two table

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss comparing two table in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
John Kim
 
Posts: n/a

Default comparing two table - 11-11-2011 , 06:11 AM






i have two tables.

one table - tbl_attempted issue has number field with the following
values.


number field record values - 1, 3, 4, 5


the other table - tbl_issues_out has another number field with the
following value.


number field record value - 7


IS THERE A WAY TO CHECK THESE TWO TABLES and come up with values,


2, 6


??


the other table with value 7 is the issues sent out so far, and the
first table is attempted issue so far.


since issue 1, 3, 4, 5 and attempted, and up to issue 7 are sent
out..


SQL code should compare 7 against 1, 3, 4, 5 and come up with 2, 6.


CAN ANY BODY HELP ME WITH SQL CODE TO DO THIS??

Reply With Quote
  #2  
Old   
Andrew Morton
 
Posts: n/a

Default Re: comparing two table - 11-11-2011 , 07:01 AM






John Kim wrote:
Quote:
CAN ANY BODY HELP ME WITH SQL CODE TO DO THIS??
COULD YOU NOT MAKE ANY PROGRESS BY LOOKING AT MY PREVIOUS REPLY?

--
Andrew

Reply With Quote
  #3  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: comparing two table - 11-11-2011 , 04:40 PM



John Kim (jinumarketing (AT) gmail (DOT) com) writes:
Quote:
i have two tables.

one table - tbl_attempted issue has number field with the following
values.


number field record values - 1, 3, 4, 5


the other table - tbl_issues_out has another number field with the
following value.


number field record value - 7


IS THERE A WAY TO CHECK THESE TWO TABLES and come up with values,


2, 6
You need a table with numbers, that is a table that has all numbers
from 1 and up. Read more here:
http://www.sommarskog.se/arrays-in-sql-2005.html#tblnum
You should only to read down to the header "An Inline Function".


--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.