Peter Haworth wrote:
> But, it now only gives me one row in the result with columns from the
> last selected record plus the a column for the sum function.  What I
> was hoping to get was all the individual rows that qualify in the
> WHERE clause with a column containing the sum for all the selected
> rows tacked on to each row.
> 
> After thinking about that, I'm feeling like that is probably not going
> to be possible but just on the off chance, is there a way to do that?

There is, but it'll likely be noticeably slower than just running two separate 
statements, or calculating the sum in the host application.

select col, (select sum(col) from mytable)
from mytable;

Igor Tandetnik

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to