Saturday, February 25, 2012

Question

SELECT DISTINCT(xxx) from table1
result:
a
b
c
I want the result
if a then x
if b then y
if c then zHi joe,
This should be your sql.
select distinct
(case when result = 'a' then 'x'
when result = 'b' then 'y'
when result = 'c' then 'z'
end) from table1
Amarnath
"joe" wrote:

> SELECT DISTINCT(xxx) from table1
> result:
> a
> b
> c
> I want the result
> if a then x
> if b then y
> if c then z
>

No comments:

Post a Comment