Solved

sql server without using the operator EXCEPT

Posted on 2011-03-18
2
250 Views
Last Modified: 2012-05-11
hi experts, i have this query
SELECT ProductID
FROM Production.Product
      EXCEPT
SELECT ProductID
FROM Production.WorkOrder

how I can resolve this without using the operator EXCEPT
0
Comment
Question by:enrique_aeo
[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
2 Comments
 
LVL 56

Accepted Solution

by:
HainKurt earned 250 total points
ID: 35166325
try

SELECT p.ProductID
FROM Production.Product p left join Production.WorkOrder w on p.ProductID=w.ProductID
where w.ProductID is null

0
 
LVL 56

Assisted Solution

by:HainKurt
HainKurt earned 250 total points
ID: 35166343
or

select p_ProductID as ProductID
from (
  SELECT p.ProductID p_ProductID, w.ProductID w_ProductID
  FROM Production.Product p left join Production.WorkOrder w on p.ProductID=w.ProductID
  ) x
where w_ProductID is null

0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

634 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