Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Join with 2 COUNT( ) columns
Message
De
04/05/2001 10:30:13
 
 
À
03/05/2001 20:48:32
Adam Skowronski
Custom Designed Systems
Miami, Floride, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00492027
Message ID:
00503494
Vues:
23
>Hi Rich, I appreciated the replies you and Nadia sent back in March, and sorry for not getting back before this, but I've been sidetracked. The solution you provided does work, however, what I failed to state is that I don't wish to perform this for a single ZipCode, but for a whole table (query) of zips. In VFP this wouldn't be a problem, but I'm populating a table for a webpage, and to have the SELECT's below run for each line (record) would be very load intensive. Thus, I was looking for a query that would do it all in one server construct. If you have any further ideas, I'd be glad to try them out.
>
>Adam

It's been a while, but I'm pretty sure the queries give results for all delivery/billing date, zipcode combinations after your specified date and you don't have to run the process for separately for each zip code.

I know when I first looked at it I tried to get it into one query (a holdover from my APL programming days) and couldn't.

Unfortunately, I'm not a web developer so I don't really understand all the issues.

Probably someone else here will be able to give a better answer.

..........Rich

>
>
>>I'm reading your requirements differently from the way Nadya did - and I've been wrong before doing that. I think you want to know how many orders were received for each zip code and how many deliveries were made into each zip code. FWIW, here's my solution
>>
>>SELECT o.deliverydate,o.zip,00001 AS oZipCount,00000 as bZipCount;
>>  FROM [OrderData] o;
>>  WHERE o.deliverydate >= ldDate;
>>UNION ALL;
>>SELECT b.billingdate,b.zip,00000,00001;
>>  FROM [BillingInfo] b;
>>  WHERE b.billingdate >= ldDate;
>>INTO CURSOR curFirst
>>
>>SELECT deliverydate,zip,SUM(oZipCount),SUM(bZipCount);
>>  FROM curFirst;
>>  GROUP BY 1,2
>>
>>
>>Hope this is what you needed.......Rich
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform