Here are some examples of CASE used in PL/pgSQL for both an UPDATE and an
assignment:
NEW.tscore := round( (NEW.treply_scores + (CASE WHEN
NEW.scored = ''f'' THEN 0 ELSE NEW.score END) )::FLOAT / (NEW.treplies + 1) );
END IF;
IF NEW.tsco
Albert REINER writes:
> I think that the documentation for CASE is not very clear:
Maybe you will like this better (from upcoming 7.1):
http://www.postgresql.org/devel-corner/docs/postgres/functions-conditional.htm
--
Peter Eisentraut [EMAIL PROTECTED] http://yi.org/peter-e/
Saluton,
I think that the documentation for CASE is not very clear:
,[ postgres/doc.html/user/functions.htm#AEN2546 ]
|Table 5-1. SQL Functions
|Function Returns Description Example
| ...
|CASE WHEN expr THEN expr [...] ELSE expr END expr return expression
|for first tru