Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux