Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sum in select statement
Message
 
À
11/01/2007 15:08:03
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP4
Network:
Windows 2000 Pro
Database:
Visual FoxPro
Divers
Thread ID:
01184761
Message ID:
01184763
Vues:
14
thanks edward, i have actually got it working now, i left out the into "cursor" part. i have it working with a *, i have set engine to 70 as i need lots of fields from the table and others that i will have to join to.
~M

>>hi all,
>>i have the code below that i think should work but it isn't. there is a problem with the sum command but i just cannot see it. i know that its bound to be something easy but any help appreciated at this late hour
>>
>>SELECT *, sum(KBI_qty) as gtotal ;
>>	FROM KBI ;
>>	GROUP BY KBI_stkref ;
>>	ORDER BY KBI_stkref ;
>>	INTO temp8
>>
>>~M
>
>You cannot have '*' in field list, but you could
>
>SELECT KBI_stkref, sum(KBI_qty) as gtotal ;
>	FROM KBI ;
>	GROUP BY 1 ;
>	ORDER BY KBI_stkref ;
>	INTO temp8
>
>If you want more fields then they should be 'enclosed' by aggregate function(s).
Go raibh maith agat

~M
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform