Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL select mind bender #1453
Message
 
À
21/07/1998 22:40:56
Bruce Gilmour
Cal-Mour Consultants
Calgary, Alberta, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00119932
Message ID:
00119986
Vues:
23
>>>Hmm the last couple of lines disappeared on the first message.
>>
>>
>>Bruce,
>>I haven't tested this, but I moved your final paren to BEFORE the 'Group By' clause. See if it works.
>>
>>
>>CREATE SQL VIEW apinquiry AS ;
>>select * from awards!apmaster where apmaster.invoicenum ;
>>   in (select apmaster.vendornum, apmaster.invoicenum,
>>       sum(apmaster.tranamount) as sumamount where sumamount <> 0
>>       from awards!apmaster) GROUP BY invoicenum ORDER BY
>>       vendornum,invoicenum
>>
>>HTH
>>Barbara
>
>Good thought but when I do that I get a "Subquery is invalid" error.

Lets try to simplify it:
CREATE SQL VIEW apinquiry AS ;
select * from awards!apmaster, sum(apmaster.tranamount) as sumamount;
  from apmaster ;
  GROUP BY invoicenum, ORDER BY vendornum, invoicenum HAVING sumamount <> 0
The HAVING clause says to just choose sumamount values that are <> 0, and the rest matches your specs I think.

Barbara
Barbara Paltiel, Paltiel Inc.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform