|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
Help: sum values from column in counted rows
Hi- I could use some help with returning the SUM of the values from COUNT rows from a table. See query code below for what I am gathering now -
Code:
SELECT Count(LCCLASS_VW.MFHD_ID) AS CountOfMFHD_ID, LCCLASS_VW.LONGCLASS FROM LCCLASS_VW GROUP BY LCCLASS_VW.LONGCLASS HAVING (((LCCLASS_VW.LONGCLASS) Between 'QD 1' And 'QD 999')); A sample of what is returned: Count LongClass 1000 QA 1 567 QA 10 What I want to return is the sum of these two rows' Count column (or 1567). Thanks for any help! Mike |
|
#2
|
|||
|
|||
|
Code:
SELECT count(*) AS CountOfMFHD_ID FROM LCCLASS_VW where LONGCLASS Between 'QD 1' And 'QD 999' |
|
#3
|
|||
|
|||
|
Hey, Thanks for the quick resopnse. It did the trick, much appreciated there swampboogie
.mike |
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > Help: sum values from column in counted rows |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|