Hi,
I've been using SQL for a long time, but only very occasionally. So I get what I want with basic SELECT queries and then do the more complicated stuff in code.
For my current project I try to do something that I guess is trivial in SQL, but I can't get it to work
I'm using SQLLite, table has two colums
Amount | AcctNo
------------------
10 | 9113.12
15 | 9113.12
30 | 9114.10
I want a SUM for the DISTINCT AcctNO's. So the result should be
9113.12 | 25
9114.10 | 30
I've tried things like:
SELECT SUM(amount) FROM tbl WHERE acctno IN (SELECT DISTINCT AcctNo FROM tbl)
But I'm never getting anything more then 1 line
All suggestions welcome!
Bas