Do not use on any
shared computer
September 5, 2008 07:13pm pdt
 
[x]
Attachment Details

sql

I need to get the annual revenue for Transfer prospects(defined by alliance_member_classification = 'TPR')

for this I need to join 2 tables such as:
fh_history(business_id, history_trans_id, campaign_history_date, campaign_nbr, annual_revenue)
allaince_history(business_id, contact_id, alian_id, campaign_nbr,fedex_acct_nbr,  alliance_member_classification )


where prospect_id ( is defined as business_id + contact_id - one business can have multiple contact_ids and one alliance can have
mulitple prospects. One campaign can have only many prospects.

Revenue should not be double counted..
for example:
business_id   contact_id   fedex_acct_nbr    annual_revenue
 5             12            1                  5000
 5             13            1                  5000  
 5             14            1                  5000


one business has multiple contacts . so in above example the annual reveue shoule be 5000 and not 15000
Start your free trial to view this solution
Question Stats
Zone: Database
Question Asked By: Sara_j_11
Question Asked On: 05.13.2008
Participating Experts: 1
Points: 500
Views: 0
Translate:
Loading Advertisement...
 
[+][-]Expert Comment by imran_fast

Rank: Guru

Expert Comment by imran_fast:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by Sara_j_11
Author Comment by Sara_j_11:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by imran_fast

Rank: Guru

Expert Comment by imran_fast:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Administrative Comment by dvz
Administrative Comment by dvz:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
20080723-EE-VQP-34 / EE_QW_2_20070628