[SQL] Documentation for CASE

2000-12-16 Thread Albert REINER
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

Re: [SQL] Documentation for CASE

2000-12-16 Thread Peter Eisentraut
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/

Re: [SQL] Documentation for CASE

2000-12-16 Thread Robert B. Easter
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