[thelist] SQL Group By question

Bill Moseley moseley at hank.org
Wed Dec 6 16:02:49 CST 2006


On Wed, Dec 06, 2006 at 01:54:08PM -0600, Casey Crookston wrote:
> If a table looks like this:
> 
>  
> 
> ID         Name    Group
> 1          NameA Group1
> 2          NameB Group1
> 3          NameC Group2
> 4          NameD Group2
> 
> Is it possible to build a query that would return these results:
> 
>  
> 
> Group1
> NameA
> NameB
> Group2
> NameC
> NameD

You want the rows returned like the above or do you want to display it
like the above?

Do you really just need to sort so it looks like this?

Group1 NameA
Group1 NameB
Group2 NameC
Group2 NameD

Then print the Group name when it changes?



-- 
Bill Moseley
moseley at hank.org




More information about the thelist mailing list