Re: Group By



Achim,

If you are looking to do the eqivalent of a GROUP BY in a SELECT query
against your result-set, you might want to try the assembly I've been
working on at http://www.queryadataset.com. It lets you perform complex SQL
SELECT statements including UNION, JOINS, GROUP BY, HAVING, ORDER BY,
sub-queries, etc against the tables in a dataset.

The web-site allows you to upload your own XML data fragment, DataSet or
resultset and issue queries using the QueryADataSet assembly. If the query
returns the results you expect, then this assembly might be what you are
looking for. Note the result of any query from this assembly is a standard
DataView object.

Hope this helps
Ad.


"Achim Domma (Procoders)" <domma@xxxxxxxxxxxxx> wrote in message
news:d6vc8l$a1h$03$1@xxxxxxxxxxxxxxxxxxxx
> Hi,
>
> I have a resultset with different columns which I would use to group the
> data by. For examle:
>
> Name Categ Year
> AAA 1 2003
> BBB 1 2004
> CCC 2 2003
> DDD 2 2004
>
> I want to have differnt views of this data like this:
>
> 1 - 2003 - AAA
> 2004 - BBB
> 2 - 2003 - CCC
> 2004 - DDD
>
> or
>
> 2003 - AAA
> CCC
> 2004 - BBB
> DDD
>
> I could solve this using multiple queries and differnt filters, but I
> wonder if there is a more elegant solution using ADO.Nets hierarchical
> features. And hints or ideas?
>
> regards,
> Achim


.



Relevant Pages

  • Re: data type error in my query
    ... the resultset returned the same value for comments. ... FROM dbo.tblWeblog as W1 LEFT OUTER JOIN dbo.tblUserComments as C ... > If blogID is a unique identifier for rows of tblWeblog, ... If I strip out W.blogComment the query runs fine. ...
    (microsoft.public.sqlserver.programming)
  • Re: When do selects execute for multiple resultsets
    ... SQL Server executes each query and stops when its ... When the first resultset is ... The CommandTimeout is measured from the time you execute the query until the ...
    (microsoft.public.dotnet.framework.adonet)
  • refreshing a window
    ... the query is processed, the results do not come up at the bottom until ... private JTextField output, input, input1, input2, input3; ... ResultSet resultSet; ...
    (comp.lang.java.programmer)
  • Re: Cant get JDBC to work from Java to MySQL
    ... ResultSet rs = stat.executeQuery("SELECT draw_date FROM ... but process int 'ball_1' ... (Java, Stack trace, and table description - stack trace from the code ... SQL Exception:Unexpected exception encountered during query. ...
    (comp.lang.java.programmer)
  • Re: Cant get JDBC to work from Java to MySQL
    ... ResultSet rs = stat.executeQuery("SELECT draw_date FROM ... (Java, Stack trace, and table description - stack trace from the code ... compiles and prints! ... SQL Exception:Unexpected exception encountered during query. ...
    (comp.lang.java.programmer)