On Sat, Nov 14, 2009 at 7:27 PM, Peter Haworth <p...@mollysrevenge.com> wrote: > After searching around the web, it seems I can't expect the SELECT > syntax in my earlier post to work but that repeating the aliased > column logic as part of the sum function will work so I tried that and > it does indeed total things up for me. > > 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. >
Think about what you are asking for... your result set is going to contain two columns. The first column will have different values for every row, but the second column will have the same value in every row. Something like so... 5 33 3 33 7 33 4 33 9 33 5 33 and so on. What a waste. Still, if you insist on something like that, do it in your application. Else, run two separate queries and union them as Kees showed you. > 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? > > Pete Haworth > > > > > > > _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users