using GROUPBY

A

alf

Hi:
I'm trying to use a query to group and get the total of some fields using
some conditions.
this is an example:

SELECT Sum(table1.field1) AS SumField1, table1.field2, table2.field1,
table2.field2.....
FROM table1 INNER JOIN table2 ON table1.diels2=table2.field1
GROUP BY table1.field2, table2.field2
HAVING (table2.field3=nn) AND (table2.field4=mm) AND (table2.field5>=kk)
.....

basically is this query, but do to the condition (table2.field5>=kk) I get
divided the registries in each values of table2.field5 an my purpose is to
get it all values together in the same SUM.
How can I get this ??
thanks,
alf.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top