| From: | Felipe Araoz Ramos <faraoz(at)gmail(dot)com> |
|---|---|
| To: | PostgreSQL-foro <pgsql-es-ayuda(at)postgresql(dot)org> |
| Subject: | Select anidado dentro de Case when |
| Date: | 2014-09-21 14:30:03 |
| Message-ID: | CAM6fARwGGu75VLmFPxREwbVCjBv+uMOtvoHPn3Hv6mHJ8O1+JA@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-es-ayuda |
Buen dias amigos del foro
Estoy queriendo hacer mas flexible mi función y quiero hacer algo como
esto; anidar select dentro de un bloque case,... es posible hacer esto
begin
return query
case when $1='1' then
select c1,c2 from tabla where c1='ME' and c2='2013'
else
select c1,c2 from tabla where c1='ME'
end;
end;
$BODY$
LANGUAGE plpgsql VOLATILE
COST 100
ROWS 1000;
Gracias de antemano
*Felipe Araoz Ramos*
RPM #941990605 / 941990605
RPC 992760385
NXT 822*9500 / 998229500
| From | Date | Subject | |
|---|---|---|---|
| Next Message | felix gonzales | 2014-09-21 14:50:35 | Re: [pgsql-es-ayuda] Re: [pgsql-es-ayuda] webinar sobre Replicación Bi Direccional (BDR) en PostgreSQL |
| Previous Message | Guillermo E. Villanueva | 2014-09-21 03:06:45 | Re: [pgsql-es-ayuda] webinar sobre Replicación Bi Direccional (BDR) en PostgreSQL |