Subscribe to this thread
Home - General / All posts - M8 SQL syntax select sum/group by
ColinD

2,081 post(s)
#21-Mar-20 22:00

Sorry, very basic!

Referencing a points drawing with columns Site holding values 0 or 1 and Habitat I wish to sum Site grouped by Habitat. The following lists the totals only. What is the syntax to include the matching Habitat in the resulting table?

select sum([Site]as Total from [Drawing] group by [Habitat];

Thanks


Aussie Nature Shots

tjhb
10,094 post(s)
#21-Mar-20 22:11

Just

SELECT [Habitat], SUM([Site]AS [Total]...

ColinD

2,081 post(s)
#21-Mar-20 23:44

Thank you Tim, keep well


Aussie Nature Shots

Manifold User Community Use Agreement Copyright (C) 2007-2021 Manifold Software Limited. All rights reserved.