pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Albert REINER <areiner@tph.tuwien.ac.at>
To: PostgreSQL-SQL <pgsql-sql@postgreSQL.org>
Subject: Documentation for CASE
Date: Sat, 16 Dec 2000 18:00:58 +0100
Message-ID: <20001216180058.A738@frithjof> (raw)

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  true  WHEN  clause  CASE WHEN c1 = 1 THEN 'match' ELSE 'no
|    match' END
`----

When building a statement with more than one clause, I was tempted to
write CASE WHEN a THEN b ELSE WHEN c THEN d ELSE e instead of the
correct CASE WHEN a THEN b WHEN c THEN d ELSE e.

Also, to be correct, the description should mention what the ELSE
clause is good for (though it's not difficult to guess).

I'm sorry to have bothered you if this was already corrected for more
recent versions - I'm running

,----
| albert=> select version();
| 				version
| --------------------------------------------------------------------
|  PostgreSQL 7.0.2 on i586-pc-linux-gnulibc1, compiled by gcc 2.95.1
| (1 row)
`----

Bye,

Albert.


-- 

--------------------------------------------------------------------------
Albert Reiner                                   <areiner@tph.tuwien.ac.at>
Deutsch       *       English       *       Esperanto       *       Latine
--------------------------------------------------------------------------



view thread (4+ messages)  latest in thread

Message-ID: <20001216180058.A738@frithjof>
Permalink:  ../20001216180058.A738@frithjof/
Also on:    postgresql.org/message-id/20001216180058.A738@frithjof

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: areiner@tph.tuwien.ac.at
  Subject: Re: Documentation for CASE
  In-Reply-To: <20001216180058.A738@frithjof>
  References: <20001216180058.A738@frithjof>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox