Solved

TSQL Not In Type

Posted on 2014-04-26
3
288 Views
Last Modified: 2014-04-30
Hello All,

There are two tables having several columns. Now there are three column - account,product,month in both of the tables tblA and tblB.

I want to find out all the rows for the combination of account,product and month which is in tblA BUT not in tblB

Any ideas?
0
Comment
Question by:Rayne
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
ProjectChampion earned 500 total points
ID: 40025210
Try this:
Select A.*
From tblA A Left Outer Join tblB B
On A.Account = B.Account And A.Product = B.Product And A.Month = B.Month
WHERE B.Account Is Null;
0
 

Author Comment

by:Rayne
ID: 40025243
Thank you Dara
0
 

Author Comment

by:Rayne
ID: 40033932
Thank you sire, your help saved me big time :)
Thank you
0

Featured Post

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question