Case with Char(1)

Поиск
Список
Период
Сортировка
От Ezequias Rodrigues da Rocha
Тема Case with Char(1)
Дата
Msg-id 55c095e90702280502x3673fe6g67e7cb5de714356f@mail.gmail.com
обсуждение исходный текст
Ответы Re: Case with Char(1)  (Andrew Sullivan <ajs@crankycanuck.ca>)
Re: Case with Char(1)  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-sql
Hi list,

it is possible to use case with character (1) ?

I am having problems to formate the SQL statement.

I have:

SELECT * FROM test;
a
---ABC


SELECT a,      CASE WHEN a='A' THEN 'one'           WHEN a='B' THEN 'two'           ELSE 'other'      END   FROM test;
a | case
---+-------A | oneB | twoC | other

I know from all program languages that case do not apply to noun
sequencialiable (if this word exists) variable (like integers etc).

Any help would be greatfull.

Thanks in advance
Ezequias


В списке pgsql-sql по дате отправления:

Предыдущее
От: Andreas Joseph Krogh
Дата:
Сообщение: Re: Conditional NOT NULL constraint
Следующее
От: Andrew Sullivan
Дата:
Сообщение: Re: Case with Char(1)