?
Solved

TSQL Not In Type

Posted on 2014-04-26
3
Medium Priority
?
296 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 2000 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

Get MySQL database support online, now!

At Percona’s web store you can order your MySQL database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card.

Question has a verified solution.

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

If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
New style of hardware planning for Microsoft Exchange server.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

777 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