Solved

TSQL Not In Type

Posted on 2014-04-26
3
282 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
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
ProjectChampion earned 500 total points
Comment Utility
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
Comment Utility
Thank you Dara
0
 

Author Comment

by:Rayne
Comment Utility
Thank you sire, your help saved me big time :)
Thank you
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now