>I have a table of tree information that I need to get the tree species with the highest stocking for every plot in the table.
>
>I need to get the trees.species_98 with the highest sum(trees.ba_98)for every occurance of trees.plot in the table.
>
>Select top 1 only gives me the first plot.
>
>This statement get closer but I hardcoded in the number of plots which may not be known and also sum(trees.ba_98) is the trees.plot total and not the total of the highest trees.species.
>
>SELECT TOP 752 trees.species_98, sum(trees.ba_98), trees.plot FROM trees GROUP BY trees.plot ORDER BY trees.plot
>
>Any ideas would be greatly appreciated.
Quinn,
Would you elaborate a bit. How is the structure like, what should be summed with some sample data etc.
Cetin