[thelist] SQL Group By question

Casey Crookston caseyc at IntelliSoftmn.com
Wed Dec 6 14:34:28 CST 2006


SELECT a.* FROM vw_norfire_projects a
WHERE a.JobType =
(SELECT * FROM vw_norfire_projects WHERE JobType = a.JobType)

But that does not work...

Only one expression can be specified in the select list when the
subquery is not introduced with EXISTS.

Is this something that will need to be done in the coding logic and not
the query?


-- 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