Re: [HACKERS] Modulo syntax

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: [HACKERS] Modulo syntax
Дата
Msg-id 199903172201.RAA17748@candle.pha.pa.us
обсуждение исходный текст
Ответ на Modulo syntax  (Oleg Broytmann <phd@sun.med.ru>)
Список pgsql-hackers
Fixed now.

> Hello!
> 
>    I ran the query
> update producers SET cor_id = producer_id % 9 + 1;
> 
>    and found that result is eqiuvalent to
> update producers SET cor_id = producer_id % 9;
> 
>    I added parens:
> update producers SET cor_id = (producer_id % 9) + 1;
> 
>    and got what I needed.
> 
>    Is it a bug, a feature, or I just misinterpreted the syntax?
> 
> Oleg.
> ---- 
>     Oleg Broytmann     http://members.xoom.com/phd2/     phd2@earthling.net
>            Programmers don't die, they just GOSUB without RETURN.
> 
> 
> 


--  Bruce Momjian                        |  http://www.op.net/~candle maillist@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


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

Предыдущее
От: Michael Davis
Дата:
Сообщение: RE: [HACKERS] Use of multiple || and precidence
Следующее
От: Vince Vielhaber
Дата:
Сообщение: &