Use in the GROUP BY a copy of the same code that appears in
the corresponding item in the SELECT list. For example, if
the item is "case when code = b then col1 else col2 end" in
the select, include the same as one of the items in the
GROUP BY.

-- Eldon Tucker

At 03:58 PM 8/14/01 +0000, you wrote:
>Hi team,
>
>I am trying to do a GROUP BY on column that has no name. As far as I know I
>cannot use numbers the same way I can with ORDER BY, for example ORDER BY
>1,2, etc.
>
>Here is an example of the column I am trying to group by:
>.....
>CASE When code=b Then COL1
>      Else COL2
>....
>
>
>Any ideas?  I even tried to name the column with SELECT...AS "NEW_NAME" and
>GROUPed BY this name but I got an error.


=====
To unsubscribe, send 'unsubscribe' to [EMAIL PROTECTED]
For other info (and scripts), see http://people.mn.mediaone.net/scottrmcleod

Reply via email to