Re: Getting the sum() for a column from a joined table

2010-01-03 Thread Octavian Ra?ni??
Thank you for this solution. It is working, although I was hoping that it could be possible to do it without sub-selects because I want to implement it in an ORM that doesn't fully supports sub-selects yet. -- Octavian "LIU YAN" wrote in message news:snt102-w5962ed9a8e5cb50a275855cb...@phx.g

RE: Getting the sum() for a column from a joined table

2010-01-02 Thread LIU YAN
hi , Octavian you can try this SQL. = select agents.id, agents.name, (select count(*) from clients where agent=agents.id), (select sum(value) from sales where agent=agents.id) from agents where agent.id=100 =