Re: or function

Поиск
Список
Период
Сортировка
От chester c young
Тема Re: or function
Дата
Msg-id 20061230181038.48746.qmail@web54313.mail.yahoo.com
обсуждение исходный текст
Ответ на or function  ("A. R. Van Hook" <hook@lake-lotawana.mo.us>)
Список pgsql-sql
--- "A. R. Van Hook" <hook@lake-lotawana.mo.us> wrote:

> I have been trying to do an 'or' function such that if a field value
> is 
> zero then use 1 as a multiplier:
>  "select sum((1 | i.count) * s.cost) as COST ...

try "select sum( (case when i.count=0 then 1 else i.count end) * s.cost
) as COST ...

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


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

Предыдущее
От: "A. R. Van Hook"
Дата:
Сообщение: or function
Следующее
От: Tom Lane
Дата:
Сообщение: Re: or function