Received: from omega.bkc.lv (omega.bkc.lv [195.244.128.2]) by hub.org (8.9.3/8.9.3) with ESMTP id IAA89978 for ; Wed, 26 May 1999 08:45:27 -0400 (EDT) (envelope-from emils@mail.usis.bkc.lv) Received: from mail.usis.bkc.lv (mail.usis.bkc.lv [195.244.132.2]) by omega.bkc.lv (8.9.1/8.9.1) with ESMTP id PAA07938 for ; Wed, 26 May 1999 15:45:22 +0300 (EEDT) Message-Id: <199905261245.PAA07938@omega.bkc.lv> Received: from USIS-RIGA/SpoolDir by mail.usis.bkc.lv (Mercury 1.44); 26 May 99 15:50:40 EET Received: from SpoolDir by USIS-RIGA (Mercury 1.44); 26 May 99 15:50:38 EET From: "Emils Klotins" Organization: USIS Riga To: pgsql-sql@postgreSQL.org Date: Wed, 26 May 1999 15:50:09 EET MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: CASE WHEN / 6.4.2? + no doc in installed documentation Reply-to: emils@mail.usis.bkc.lv Priority: normal X-mailer: Pegasus Mail for Win32 (v3.02b14) Hello. Could somebody please tell what is the correct form for either IFNULL or CASE SQL functions in PG? I have a SELECT that needs to return a value, if another value is not null, otherwise it should return a string 'N/A': A simpliefied version of SELECT is this: SELECT category, CASE (WHEN category IS NULL THEN 'N/A' ELSE name) AS name FROM mytable; I get 'parse error near category'. What would be the correct form or alternate way to do this? Thanks in advance for any help!! NB. SQL functions are NOT mentioned at all in the PG documentation which comes with the 6.4.2 version in SuSE 6.1 Linux. I only found it in the "User's guide", section 6 of the PG documentation on Postgresql.org web site. ------------------------------------------------ Emils. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Message of the day: Ambition is a poor excuse for not having enough sense to be lazy. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= RSA PGP key published on: http://pgpkeys.mit.edu:11371