Re: select where true, or select where input = '$var'

Поиск
Список
Период
Сортировка
От John R Pierce
Тема Re: select where true, or select where input = '$var'
Дата
Msg-id 54E64CB7.3090401@hogranch.com
обсуждение исходный текст
Ответ на select where true, or select where input = '$var'  (zach cruise <zachc1980@gmail.com>)
Список pgsql-general
On 2/19/2015 12:39 PM, zach cruise wrote:
> i want to select based on input, but if input is not provided or if
> input is empty, then i want to select all rows.

(metalanguage)   if input is provided, then query("SELECT stuff FROM
table WHERE whatever = $INPUT")
                                           else, query("SELECT stuff
FROM table")

in other words, make the decision as to what query to execute OUTSIDE of
sql by invoking different queries based on your application's 'input'.



--
john r pierce                                      37N 122W
somewhere on the middle of the left coast



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

Предыдущее
От: Juan Pablo L
Дата:
Сообщение: rollback in C functions
Следующее
От: Paul Jungwirth
Дата:
Сообщение: Re: select where true, or select where input = '$var'