Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Newbie at select statements
Message
De
02/11/2000 11:29:27
 
 
À
01/11/2000 17:35:25
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00436920
Message ID:
00437157
Vues:
29
>In the 2nd one, the outer records - i.e., the records for scorder table that don't match the records in the scordln table - are included in the results, and therefore in the sum.
>Add the bold line below to make the 2nd one behave like the first.
>
>
select sum(scordln.orl_qty-scordln.orl_qtyinvoiced) as nqty ;
>  from scordln left outer join scorder ;
>  on scordln.orl_order = scorder.ord_order ;
>  where scorder.ord_acct < 201 ;
>  <b>having !isnull(scorder.ord_acct)</b> ;
>  into cursor cqty
>

I swear this worked when I tested it before I posted it yesterday, but I tried it again today and it didn't. I was surprised that it did work, because HAVING is supposed to only work with a GROUP BY.

Since the one with the BETWEEN() works - just go with that one. <s>

For a good explanation of what's happening, see Ed Rauh's response to me on the other thread. Message#437085
Insanity: Doing the same thing over and over and expecting different results.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform