Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with Recursive Query 2

Status
Not open for further replies.

FumaBob

Technical User
Sep 25, 2009
6
US
Hello

I don't know what is so wrong with me that I can't understand how to do a recursive query. It's just something that I cannot get my head around. Here's what I'm hoping to do and maybe someone can help?

I have 2 tables.

CLAIMS (has 2 columns: Date and RepID)
ORDERS (has 3 columns: Date, RepID, and OrderNum)

I want to see all OrderNum(s) for each Date and RepID where a claim was made.

Example: RepID 123A had a Claim charge to them on 5/10/11
I need to see all OrderNum(s) worked by 123A on 5/10/11
(of course, I need to repeat this for 10,000 unique Claims based on Date and RepID)

A million thanks in advance for help teaching me!

 
Hi,
I'm not sure I understand you as from what you've said the following query would suffice, but as it seems too straightforward so I'm guessing I've missed something
Code:
SELECT O.ORDERNUM
FROM   ORDERS O
      ,CLAIMS C
WHERE  C.REPID = O.REPID
AND    C.DATE  = O.DATE
 
Thank you Marc for the help; I often overlook the obvious. You solution worked perfectly!!!

And thank you sathyarams for the tutorial. It helped me though some questions I had.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top