Need a SQL query

Experts,

I need a SQL query and the details are attached.

Thanks for your help.
doc2.docx
Tpaul_10Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
awking00Connect With a Mentor Commented:
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
 
Éric MoreauSenior .Net ConsultantCommented:
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
 
WaibelRDConnect With a Mentor Commented:
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
What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

 
awking00Commented:
Select QNumber from QNumbers where DiscountType in (A','B')
intersect
Select QNumber from QDetails where DiscountGiven is null;
0
 
awking00Commented:
Not quite, need to deal with P7 case.
0
 
Tpaul_10Author Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.