sql - How do I sum one column within a grouping of another column? -



sql - How do I sum one column within a grouping of another column? -

this problem:

name date presents bob march 3 2011 1 bob june 6 2008 2 bob jan 3 2012 3 mary feb 14 1986 4 mary apr 10 2001 5 mary jan 3 2012 6 kate march 3 2011 7 kate jan 3 2012 8 kate oct 9 2013 9 celia march 3 2011 10 celia feb 14 1986 11 celia july 4 2011 12 celia jan 3 2012 13 celia feb 14 1991 14

so goal add together amount of presents kate , celia got on same days if received @ on days.

what need kind of this, except much bigger info set. size of info set around 100,000 entries.

i need reply in sql, or access 2003 query.

if presents number of presents kate or celia or somepne else got on particular date:

select name, date, sum(presents) total_on_date table name in ('kate','celia') grouping name, date

and no means sql genius

sql ms-access

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -