Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Complicated Query
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01366648
Message ID:
01366689
Vues:
12
> You can not do this in one query in VFP (except for using UDF), though you can do this easily in SQL Server.

Why not? What I am missing?
select		vou_no, ;
		Sum(Iif(party = 'A', qty, 0)) as A, ;
		Sum(Iif(party = 'B', qty, 0)) as B, ;
		Sum(Iif(party = 'C', qty, 0)) as C, ;
		Sum(Iif(party = 'D', qty, 0)) as D, ;
		Sum(rate * qty) as cr_amount ;
	from	Temp ;
	group	by 1 ;
	into	cursor Temp2

BROWSE LAST NORMAL nowait 
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform