Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need Assistance With A Query
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01035195
Message ID:
01035205
Vues:
11
Try
SELECT ;
		UserId, ;
		COUNT(*) AS NumSpots, ;
		COUNT(DIST invoiceid) AS Invoices, ;		
		SUM(Gross) AS TotalGross, ;
		SUM( IIF(Status = 'D', 1, 0)) AS Discrep, ;
		SUM( IIF(Status = 'R', 1, 0)) AS Reconciled ;
	FROM Commits ;	
	GROUP BY 1
>I need to pull invoice records from a table called 'Commits'.
>I need to following data, rolled up by column UserId:
>
>
>UserId       - Id of the user who created the record
>NumSpots     - Equal to the # records retreived for the user
># Invoices   - Would be the same as 'select disticnt invoiceid where userid =...'
>Total Gross  - SUM of the Gross column, by user
>Discrep      - Total number of records with Status = 'D', by user
>Reconciled   - Total number of records with Status = 'R', by user
>
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform