aggregation

Is there an Oracle SQL query that aggregates multiple rows into one row?

I have a table that looks like this: A 1 A 2 B 1 B 2 And I want to produce a result set that looks like this: A 1 2 B 1 2 Is there a SQL statement that will do this? I am using Oracle. Related questions: Returning multiple rows from a single row My question is close to the opposite of this question. Use LINQ to concatenate...

UML Notation - Aggregations/Compositions vs "Vanilla" Associations

I've recently spent a good deal of time performing detailed UML designs of various SW components that I have since written. Looking back on what I have recently finished and comparing that to when I first learned UML, I see that I now almost strictly use Aggregation and Composition relationships, and have virtually abandoned "vanilla" no...

Aggregates and Repository. How to determine aggregates?

I have recently been looking at the Repository Pattern as a way of brushing all the details of persistence under the carpet where the client code is concerned. While reading around it appears that a Repository is/can be [usually?] responsible for aggregates rather than just straight-forward classes. This make sense to me as you could h...

SQL Server PIVOT - Multiple Aggregates

Given the following result set: --------------------------------------------------------- CustomerID  Service  TransType  SubTotal   Tax   NetTotal --------------------------------------------------------- 106           A        CREDIT     12.52   -   12.52 106 A        CREDIT     10.07   -   10.07 106           ...

How To Clone/Mutate A Model In Django Without Subclassing

'Ello, all. I'm trying to create a model in Django based on - but not subclassing or having a DB relation to - another model. My original model looks something like this: it stores some data with a date/time stamp. class Entry(Model): data1 = FloatField() data2 = FloatField() entered = DateTimeField() I'd also like ...

Encapsulation Aggregation / Composition

The Wikipedia article about encapsulation states: "Encapsulation also protects the integrity of the component, by preventing users from setting the internal data of the component into an invalid or inconsistent state" I started a discussion about encapsulation on a forum, in which I asked whether you should always clone objects inside...

distinguishing between delegation, composition and aggregation (java OO design)

Hello, I am facing a continuing problem distinguishing delegation, composition and aggregation from each other, and identifying the cases where its best to use one over the other. I have consulted an java OO analysis and design book, but my confusion still remains. The main explanation is this: delegation: When my object uses another ...

SSAS aggregation not being used

So I have a fairly hefty cube that won't be much good without aggregations. I'm still in dev phases, so I'm manually attempting usage based agg design. I'm aggregating some of the main queries that we've designed. However, every time I pull these up, it looks like it's reading through each partition it hits (biggest groups are partitione...

Aggregation: Life after death or no?

I have been reading a couple of articles on stack overflow about aggreation and how it compares to delegation and composition. Mainly: http://stackoverflow.com/questions/1384426/distinguishing-between-delegation-composition-and-aggregation-java-oo-design According to this and other articles I have read on here, the concession is that a...

efficient web parsing approach - aggregation issue

Hi. A number of sites do aggregation (indeed.com, simplthired.com,expedia...) I'm trying to figure out a good/efficient way of determining that the data I get from parsing data from a page is valid. In particular, if I parse a page multiple times, (say once a day) how do I 'know' that the data i get on any given time is valid? I'm cons...

choosing latest string when aggregating results in mysql

I've been tasked to do generate some reports on our Request Tracker usage. Request Tracker is a ticketing system we use for several departments were I work. To do this I'm taking a nightly snapshot of details about tickets altered for the day into another database. This approach decouples my reporting from the the internal database schem...

System.AddIn (Maf) Interconnection between addins

Hey, I want to use MAF in my project because I need a robust add-in architecture. Yet I come to a point where I need to call methods of an add-in from an other add-in. How can I achieve this with a flexible manner in which some add-ins should have dependencies over other add-ins or just use other add-ins' functionality when available. ...

Breakdown of time spans between a list of Datetime's

Hello, I have a SQL Server 2005 database table, which has a datetime column. I write an entry in this table every time a service processes an incoming request. What I would like to get is a breakdown of the time spans between sequential entries. If the data is: 2009-10-30 04:06:57.117 2009-10-30 03:52:44.383 2009-10-30 03:42:00.990 2...

Java count of items in an array (similar to a SQL aggregate function)

I am connecting to a sockets API that is very inflexible. It will return rows such as: NAME, CITY, STATE, JOB, MONTH But will have duplicates because it does not do any aggregation. I need to count the duplicate rows (which would be very easy in SQL, but not, as far as I know, in Java). Example source data: NAME, CITY, STATE, ...

How can I manage a group of derived but otherwise Unrelated Classes.

It seems the more I talk about this problem the better I understand it. I think my previous question didn't convey what I am trying to do correctly. My apologies for that. In my design I have GameObjects which are essentially an aggregation class, all functionality in a GameObject is implemented by adding various "Features" to it. A Fea...

Data Aggregation :: How important is it really?

I'm curious to know where people value Data Aggregation. I'm truly curios, if you don't mind letting me know how important this really is to you personally with respect to your work environment, and if you have to work directly with data agg in your line of work. Thanks guys! Really interested to hear about your feedback. ...

Optimise aggregation query

I'm looking for a way to optimise the following: SELECT (SELECT SUM(amount) FROM Txn_Log WHERE gid=@gid AND txnType IN (3, 20)) AS pendingAmount, (SELECT COUNT(1) FROM Txn_Log WHERE gid = @gid AND txnType = 11) AS pendingReturn, (SELECT COUNT(1) FROM Txn_Log WHERE gid = @gid AND txnType = 5) AS pendingBlock where @gid is ...

Jamon statistics aggregation across multiple JVMs

Hello, I have a tomcat server running a webapp. Apart from this there are two other JVMs that run batch processing tasks. Jamon is a really cool way to monitor performance, hits etc., and can be viewed on the web using Jamonadmin.jsp (supplied with jamon war file). But I want to aggregate the Jamon statistics from the other two JVMs and...

Understanding UML of DoFactory Design Pattern - Decorator

I am trying to understand UML diagram describing Decorator Pattern at link below http://www.dofactory.com/Patterns/PatternDecorator.aspx I don't understand why there is a "Aggregation" relation between Decorator and Component. I believe it should be composition as Decorator cannot exist without the base component. ...

Summarizing two conditions on the same SQL table

Given a SQL table Transactions ID INT COMPANY_ID INT STATUS INT where STATUS IN (0,1) indicates a free transaction and STATUS IN (2,3) indicates a billable transaction, what simple (I hope) ANSI SQL statement will show me, per COMPANY_ID, the number of billable transactions, non-billable transactions, and th...