[an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] Multi-Object Queries
Gold User's Guide
<<< Previous Using the Gold Shell (goldsh) Next >>>

Multi-Object Queries

Gold supports multi-object queries (table joins). Multiple objects are specified via a comma-separated list and attributes need to be prefixed by the associated object.

Example 13. Print the current and total allocation summed by project

gold> Allocation,AccountProject Query Show:="GroupBy(AccountProject.Name),Sum(Allocation.Amount),Sum(Allocation.Deposited)" Allocation.Account==AccountProject.Account Allocation.Active==True

Name          Amount        Deposited 
------------- ------------- ------------- 
biology       193651124     360000000 
chemistry     296167659     360000000

Example 14. Show all active projects for amy or bob

gold> Project,ProjectUser Query Show:="Project.Name" ( ProjectUser.Name==bob || ProjectUser.Name==amy ) && Project.Name==ProjectUser.Project && Project.Active==True Unique:=True

Name      
------------- 
biology   
chemistry

<<< Previous Home Next >>>
Common Actions Available for most Objects Up Customizing Gold Objects
[an error occurred while processing this directive] [an error occurred while processing this directive]