[thelist] SQL Group By question
Casey Crookston
caseyc at IntelliSoftmn.com
Wed Dec 6 14:19:27 CST 2006
>>Make 2 query, frist get groups then the Names<<
Ok. Can it be done in a sub query? I'm thinking out loud here...
SELECT * FROM a.table
WHERE a.Group =
(SELECT * FROM table WHERE Group = a.Group)
-- original message --
> 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
More information about the thelist
mailing list