Re: Inserting an IF statement in the middle of a SELECT in pl/pgSQL code

Поиск
Список
Период
Сортировка
От Rodrigo De León
Тема Re: Inserting an IF statement in the middle of a SELECT in pl/pgSQL code
Дата
Msg-id a55915760707172146n75dbf69btff374c054282bdbf@mail.gmail.com
обсуждение исходный текст
Ответ на Inserting an IF statement in the middle of a SELECT in pl/pgSQL code  (Norm Garand <indianlakesolutions@rogers.com>)
Список pgsql-sql
On 7/17/07, Norm Garand <indianlakesolutions@rogers.com> wrote:
> /---------------
>  IF $7 IS NOT NULL THEN
>   AND f.id = pid.specific_location_cid AND f.long_desc = $7
>  END IF
> ---------------/

How about:
  AND f.ID = pid.specific_location_cid  AND f.long_desc = COALESCE ($7, f.long_desc)


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

Предыдущее
От: Norm Garand
Дата:
Сообщение: Inserting an IF statement in the middle of a SELECT in pl/pgSQL code
Следующее
От: "Jaime Casanova"
Дата:
Сообщение: Re: Inserting an IF statement in the middle of a SELECT in pl/pgSQL code