Solved

Need a SQL query

Posted on 2013-01-03
6
357 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
6 Comments
 
LVL 69

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 50 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 31

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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 31

Expert Comment

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

Accepted Solution

by:
awking00 earned 450 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
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…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

759 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

19 Experts available now in Live!

Get 1:1 Help Now