Re: Is it possible to group data in a dataset?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Patrick Steele [MVP] (patrick_at_mvps.org)
Date: 05/26/04


Date: Wed, 26 May 2004 09:35:05 -0400

In article <#V3ao6pQEHA.1048@tk2msftngp13.phx.gbl>, amadelle@yahoo.com
says...
> r u seriously asking me that question?

Yes, I am.
 
> I don't have to have aggregate functions to use a Group by Clause.

True. But you don't need group by to do what you want.
 
> tblAccounts
> accountID userID
> 1 23
> 2 23
> 3 23
> 4 35
> 5 35
>
> the group by clause that I have will return the following:
>
> UserID
> 23
> 35

Look into SELECT DISTINCT.

-- 
Patrick Steele
Microsoft .NET MVP
http://weblogs.asp.net/psteele


Relevant Pages

  • Re: Multiple rows to one row
    ... add a GROUP BY clause and use the CONCATENATE set function in ... the SELECT clause. ... SQL Aggregate Functions ...
    (microsoft.public.access.queries)
  • Re: GROUP BY ALL not as expected
    ... "If any columns in the select list do not have aggregate functions ... a where clause restricts the rows that are included ... returned by the query, but does not affect the calculation of the ...
    (comp.databases.sybase)
  • Re: SQL syntax error
    ... All of your returned columns that are not aggregate functions need to be ... Column 't_po_master.season' is invalid in the select list because it is ... not contained in either an aggregate function or the GROUP BY clause. ...
    (microsoft.public.sqlserver.programming)
  • Re: SQL syntax error
    ... tks a lot ... All of your returned columns that are not aggregate functions need to be ... not contained in either an aggregate function or the GROUP BY clause. ...
    (microsoft.public.sqlserver.programming)
  • Re: Date query in VBA Module
    ... since you are not using any aggregate functions there is no need to GROUP BY. ... You can use the DISTINCT operator in the query to get the same results and don't need the GROUP BY clause at all. ... Apologies for the length of the SQL etc - you can appreciate why I wanted to ...
    (microsoft.public.access.queries)