Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Compound Select
Message
De
28/08/2008 11:42:24
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Compound Select
Divers
Thread ID:
01342599
Message ID:
01342599
Vues:
48
Here is a pair of SELECTs that order a table of monthly revenue postings by category into columns by month. Some months are left out for simplicity.
select dist fisyear from rta_revenues order by fisyear into cursor crsA

select dist category, ;
		nvl((select amount ;
		from rta_revenues ;
		where fisyear = crsA.fisyear and ;
		category = crsB.category and ;
		month(receiveddate) = 9),0) as sep , ;		
		nvl((select amount ;
		from rta_revenues ;
		where fisyear = crsA.fisyear and ;
		category = crsB.category and ;
		month(receiveddate) = 10),0) as oct , ;
		nvl((select amount ;
		from rta_revenues ;
		where fisyear = crsA.fisyear and ;
		category = crsB.category and ;
		month(receiveddate) = 11),0) as nov , ;
		crsA.fisyear as fisyear ;
		from rta_revenues crsB
I would like to combine these in such a way that all the fisyears in the table, not just the first one. Can someone help?
Thanks
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform