Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Need a SQL query

Posted on 2013-01-03
6
Medium Priority
?
379 Views
Last Modified: 2013-01-03
Experts,

I need a SQL query and the details are attached.

Thanks for your help.
doc2.docx
0
Comment
Question by:Tpaul_10
[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
6 Comments
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 38741554
looks like homework to me. how do you think you will learn something if you don't even try to do your own homework?
0
 
LVL 1

Assisted Solution

by:WaibelRD
WaibelRD earned 200 total points
ID: 38741565
SELECT distinct QNumber
FROM QDETAILS
where DiscountGiven is NULL
and QNumber in (
select QNumber from Qnumbers where DiscountType in ('A','B'))
AND QNumber not in (
select QNumber from QDETAILS Where DiscountGiven = 'Y' )
Order by QNumber
0
 
LVL 32

Expert Comment

by:awking00
ID: 38741583
Select QNumber from QNumbers where DiscountType in (A','B')
intersect
Select QNumber from QDetails where DiscountGiven is null;
0
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
LVL 32

Expert Comment

by:awking00
ID: 38741594
Not quite, need to deal with P7 case.
0
 
LVL 32

Accepted Solution

by:
awking00 earned 1800 total points
ID: 38741831
Select QNumber from QNumbers where DiscountType in ('A','B')
intersect
Select QNumber from QDetails where DiscountGiven is null
except
Select QNumber from QDetails where DiscountGiven = 'Y'
0
 

Author Closing Comment

by:Tpaul_10
ID: 38742521
Thanks awking00 and  WaibelRD. Appreicate your help guys and sorry, I should have posted the SQL i have tried.


emoreau : DON'T ASSUME ANYTHING AND IF YOU DON'T WANT TO RESPOND, JUST SHUT UP OR DON'T RESPOND.
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

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 shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
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…

670 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