On Tue, 2005-10-25 at 18:31 +0200, Rafael Montoya wrote: > Thanks for your answer, and if i have many options like > > decode (pre.C_EST,'01','U','02','M','03','W','04','D','05','O','06','S','') > as Est > > do i have to write many else options in this way? > > select case when pre.C_EST = '01' THEN 'U' > ELSE when pre-C_EST = '02' THEN 'M' > ... > END AS EST > > Rafael
The syntax is CASE WHEN condition1 THEN value1 WHEN condition2 THEN value2 ... ELSE default_value END Oliver ---------------------------(end of broadcast)--------------------------- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq