Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 426DA475AD4 for ; Tue, 24 Sep 2002 10:16:04 -0400 (EDT) Received: from kitana.asti.dost.gov.ph (kitana.asti.dost.gov.ph [202.90.128.8]) by postgresql.org (Postfix) with ESMTP id A82D5475AE5 for ; Tue, 24 Sep 2002 10:11:30 -0400 (EDT) Received: from [10.10.5.200] (unknown [10.10.5.200]) by kitana.asti.dost.gov.ph (Postfix) with ESMTP id 847762586F for ; Tue, 24 Sep 2002 21:35:51 +0800 (PHT) Subject: select case problem From: Joseph Syjuco To: pgsql-sql@postgresql.org Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.3 (1.0.3-4) Date: 24 Sep 2002 21:45:34 +0000 Message-Id: <1032903934.28249.2.camel@Falcon> Mime-Version: 1.0 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200209/301 X-Sequence-Number: 9578 i have a table with the fields empno (not null) and division_no (null allowed) what i wanted to do is to do a select case statement such that when division_no is null itll output 'No division' if its not null itll output 'with division' unfortunately this statement doesnt work ... i need help on the correct syntax select case division_no when null then 'no division' else 'with division' end from employee;