February 22, 2013 at 10:43 am
I was wondering if there is a select command that I can use to summerize just 1 field from 6 selected?
select ROW_NUMBER() OVER(order by for_dist, twprng, section)as Stand#,
CURAGE as Age, LABEL as CoverType, TWPRNG as Township,
SECTION as Section, acres as Acres, For_Dist as District
from REGENCHK2012
where CURAGE = 5
and (CTYPE = 12 or CTYPE = 14)
and For_Dist = '1'
Is there a way to summerize acres field at the end? I haven't been able to find any examples of that in the books I looked at.
Thanks
Quinn
February 22, 2013 at 11:21 am
If you can accept the total stand-alone in a different result set, you can add this:
COMPUTE SUM(acres) --but will NOT work in SQL 2012!
to your query.
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
February 22, 2013 at 1:37 pm
Thanks Scott. That worked. I know what you are saying about being in another window.
Quinn
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply