I have a simple query:
SELECT stco, sum(STSD) As "Shipped Dollars"
FROM MSTDW
This says there is something wrong with the select column stco.
However, both fields exist and this:
SELECT stco
FROM MSTDW
works and this
SELECT sum(STSD) As "Shipped Dollars"
FROM MSTDW
Works too.
What could be wrong with having both?
Thanks
I think you want this, a group by, to get the sum of each
stcoFor apply aggregate functions you need to group; anyway, if you just want the sum of ALL column (I don’t think you want that, but I add it just in case) do
This will list each
stco, and repeat thesumof all column