Documentation for CASE

Поиск
Список
Период
Сортировка
От Albert REINER
Тема Documentation for CASE
Дата
Msg-id 20001216180058.A738@frithjof
обсуждение исходный текст
Ответы Re: Documentation for CASE  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-sql
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
--------------------------------------------------------------------------


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

Предыдущее
От: Alvar Freude
Дата:
Сообщение: Re: How to represent a tree-structure in a relationaldatabase
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: Documentation for CASE