Hi,

If you're using Db2 V7 you can try to use exactly the same CASE statement in
the group by. I thought it could work but I'm not sure.

Regards, Gert

----- Original Message -----
From: "Amir Sadeghi" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, August 14, 2001 5:58 PM
Subject: DB2EUG: SQL Question: Group By columns without name


> 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.
>
>
>
>
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
>
>
> =====
> To unsubscribe, send 'unsubscribe' to [EMAIL PROTECTED]
> For other info (and scripts), see
http://people.mn.mediaone.net/scottrmcleod
>
>


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

Reply via email to