Carlos Suarez <carlos.sua...@rolsoft.com> wrote: > I need to know how I can sum and count the field assoiated by record > more especifically this: > > I got several tables associated > ie: client --- buys > name idbuy > idcli idcli > date > and I need to count how many buys got every client
Read about GROUP BY clause in your favorite SQL textbook. select idcli, name, count(*) from client join buys on (client.idcli = buys.idcli) group by idcli; Igor Tandetnik _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users