Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



Reply
Constructing a Select Statement
Old 04-07-2006, 12:34 PM Constructing a Select Statement
Junior Talker

Posts: 2
Trades: 0
I cant figure out the joins and groupby's

We have two staging tables (Parent and Child) that contain both insert and update information. The Childs parent my be in either the Production or the Staging table.

I need to display a DISTINCT organization name and record number from the combination of the records in Parent and the Child (just one entry per organization). If there is more than one Child, or more than one parent update, just display the parent information once.
durban is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-07-2006, 05:38 PM Re: Constructing a Select Statement
Junior Talker

Posts: 2
Trades: 0

a little more info

The staging tables are used to review information entered by the users before posting to the production tables. There are two staging tables – Master and Child. The Master and the Child tables can have both New records or Updated records. To enter a Child record you need to have a Master, either in the Staging or Prod tables.

So I have a mixture of records in the Staging tables. I need to build a list which has an organ name, record number from either the Prod Master (Update in Stage Master) or Stage Master (Insert)

There can only be one entry in the list for each different organization whether it be in the Master (existing) or in the Stage (new).

The organization can be new or existing, there can be updates/inserts to the Prod master from the Stage master and updates/inserts to the Prod child form the stage child.

The problem is who do I look at first (I assume the Stage Master) and how do I join the Prod Master, Stage Master and Stage Child together to produce a single reference to a Master (whether it be Prod or Stage).

Hope this helps explain my situation…..it is pretty confusing to my…….

Thanks dan
durban is offline
Reply With Quote
View Public Profile
 
Old 04-11-2006, 11:57 AM Re: Constructing a Select Statement
Average Talker

Posts: 15
Trades: 0
Why do you join product and staging? Doesn't that kind of defeat the purpose of staging?
monsterhead78 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Constructing a Select Statement
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.20001 seconds with 12 queries