Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

count and sum how to

535603Sep 24 2006 — edited Oct 23 2006
i need to count all the rows where field1=something and field2=something and field3=something. it has to satisfy all 3 conditions before it counts.

likewise, i need a sum of the all the rows counted above.

how do i do this?
this is my sql query so far and i need to add the count and sum functionality
SELECT
field1,
field2,
field3,
field4,
field5,
FROM
table1
WHERE
field6='something' and
field2 between 30 and 32
ORDER BY
field1,field2 ASC
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 20 2006
Added on Sep 24 2006
40 comments
1,320 views