db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marco Ferretti <marco.ferre...@gmail.com>
Subject Re: pulling out a subset of records
Date Tue, 20 Oct 2015 09:46:48 GMT
as I said before, you should have a look at an SQL tutorial for aggregation
functions (eg, http://www.w3schools.com/sql/sql_functions.asp, hint: use
group by <column name>)



On Tue, Oct 20, 2015 at 10:23 AM, Bob M <rgmatthews@orcon.net.nz> wrote:

> Just to finish....................
>
> I need to work out the following:-
> (1) no. records in the subset where another field's value  is >=0
> (2) the sum of the contents of that field in those records
>
> (3) no. records in the subset where the value of the same field above is <
> 0
> (i.e. negative)
> (4) the sum of the contents of that field in those records
>
> I can code (1) and (3) but how to do (2) & (4) ?
>
> Bob M
>
>
>
> --
> View this message in context:
> http://apache-database.10148.n7.nabble.com/pulling-out-a-subset-of-records-tp144942p144949.html
> Sent from the Apache Derby Users mailing list archive at Nabble.com.
>



-- 
--
Marco Ferretti
[image: facebook] <http://facebook.com/marco.ferretti>[image: twitter]
<http://twitter.com/marcoferretti>[image: Linkedin]
<http://it.linkedin.com/in/marcoferretti>[image: Website]
<http://www.fermasoft.com> [image: public key]
<http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x3863B939F579CD16>

Mime
View raw message