Re: sql can i substitute

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: sql can i substitute
Дата
Msg-id 20041217145653.GB21935@wolff.to
обсуждение исходный текст
Ответ на sql can i substitute  (Kenneth Gonsalves <lawgon@thenilgiris.com>)
Список pgsql-sql
On Fri, Dec 17, 2004 at 16:55:45 +0530, Kenneth Gonsalves <lawgon@thenilgiris.com> wrote:
> hi
> 
> table:
> 
> name varchar(10)
> fruit integer
> 
> i want to write an sql statement like this:
> 
> select fruit from table
> 
> which should return 'good' if fruit = 1 and 'bad' if fruit =2 and 'rotten' if 
> fruit =3
> 
> can it be done?

Yes; use a CASE statement.


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

Предыдущее
От: Marcus Claesson
Дата:
Сообщение: Re: can't get the order I want after inserting new rows
Следующее
От: Bruno Wolff III
Дата:
Сообщение: Re: sql can i substitute