Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sum and GROUP BY
Message
 
 
À
17/10/2005 17:23:10
Moacyr Zalcman
Independent Consultant
São Paulo, Brésil
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Divers
Thread ID:
01059755
Message ID:
01059760
Vues:
14
This message has been marked as a message which has helped to the initial question of the thread.
select In.ID,In.a,In.b,In.c,In.d, ;	
		sum(InDet.value) as 'total' ;
	from In ;
	JOIN Indet ON In.ID=Indet.INID ;
	where  In.ID='54321' ;
	group by id,a,b,c,d
>
>Suppose I have an invoice(In) and invoice details(INdet) and I need some properties from the invoice and the total of the invoice from the invoice details
>
>The SQL Statement should be
>
>select In.ID,In.a,In.b,In.c,In.d,sum(InDet.value) as 'total' from In,Indet where In.ID=Indet.INID and In.ID='54321' group by id,a,b,c,d
>
>Is there a better way to do this?
>
>TIA
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform