Re: query
anonymous_at_discussions.microsoft.com
Date: 05/18/04
- Previous message: Garry D: "error message"
- In reply to: Hugo Kornelis: "Re: query"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 17 May 2004 22:24:05 -0700
Thank you, Hugo.
>-----Original Message-----
>On Thu, 13 May 2004 02:18:23 -0700, Freger wrote:
>
>>Hi
>>
>>I have a column in an SQL table. the column is all
numeric
>>data from 100 to more than 400. I would like to convert
>>the data in this column to something else. e.g.
>>
>>micro = <200
>>mini = between 200 and 300
>>midi = between 300 and 400
>>full > 400
>>
>>can anyone advise me how to write a query to establish
the
>>above task.
>>
>>Thank you.
>>
>>Freger
>
>Hi Freger,
>
>This can be accomplished using CASE:
>
> SELECT CASE
> WHEN (NumericData <= 200)
> THEN 'Micro'
> WHEN (NumericData <= 300)
> THEN Mini'
> WHEN (NumericData <= 400)
> THEN 'Midi'
> ELSE 'Full'
> END AS ColumnAlias
> FROM YourTable
>
>Replace column and table names as appropriate.
>
>Best, Hugo
>--
>
>(Remove _NO_ and _SPAM_ to get my e-mail address)
>.
>
- Previous message: Garry D: "error message"
- In reply to: Hugo Kornelis: "Re: query"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|