openoffice-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Meyer <johnme...@pueblocomputing.com>
Subject Re: SQL problem (SOLVED)
Date Sun, 20 Oct 2013 19:36:29 GMT
On 10/20/2013 1:14 PM, John Meyer wrote:
> Semi-solved, I think.
>
> I managed to join the following:
>
> SELECT "AGENTS"."AGENT_ID", COUNT(*) AS "Total Sales" FROM "AGENTS" 
> INNER JOIN "SALES" ON "AGENTS"."AGENT_ID"="SALES"."SALES_REP" GROUP BY 
> "AGENTS"."AGENT_ID"
>
> The only problem is I can't seem to add the agent's name.
>
>
I ended up solving the problem by breaking up the query into two 
subqueries: one to count the results and the other to join the 
information with the name.  It isn't the most elegant solution int he 
world, but it works!

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@openoffice.apache.org
For additional commands, e-mail: users-help@openoffice.apache.org


Mime
View raw message