Re: [GENERAL] What is the alternate of FILTER below Postgresql 9.4 ?

2015-02-24 Thread Roxanne Reid-Bennett
On 2/24/2015 11:29 AM, Arup Rakshit wrote: On Tuesday, February 24, 2015 06:13:21 PM Pavel Stehule wrote: Hi 2015-02-24 17:02 GMT+01:00 Arup Rakshit arupraks...@rocketmail.com: Hi, Please look at my query : [shreyas@rails_app_test (master)]$ rails db psql (9.4.1) Type help for help.

[GENERAL] What is the alternate of FILTER below Postgresql 9.4 ?

2015-02-24 Thread Arup Rakshit
Hi, Please look at my query : [shreyas@rails_app_test (master)]$ rails db psql (9.4.1) Type help for help. app_development=# select id, location, name from people; id | location | name +--+-- 2 | X| foo 3 | X| foo 4 | Y| foo (3 rows)

Re: [GENERAL] What is the alternate of FILTER below Postgresql 9.4?

2015-02-24 Thread Arup Rakshit
On Tuesday, February 24, 2015 06:14:53 PM Andreas Kretschmer wrote: Arup Rakshit arupraks...@rocketmail.com wrote: This *FILTER* method is available from 9.4, How can I get the same output below 9.4 version ? case when ... see:

Re: [GENERAL] What is the alternate of FILTER below Postgresql 9.4 ?

2015-02-24 Thread Pavel Stehule
Hi 2015-02-24 17:02 GMT+01:00 Arup Rakshit arupraks...@rocketmail.com: Hi, Please look at my query : [shreyas@rails_app_test (master)]$ rails db psql (9.4.1) Type help for help. app_development=# select id, location, name from people; id | location | name +--+-- 2

Re: [GENERAL] What is the alternate of FILTER below Postgresql 9.4 ?

2015-02-24 Thread Arup Rakshit
On Tuesday, February 24, 2015 06:13:21 PM Pavel Stehule wrote: Hi 2015-02-24 17:02 GMT+01:00 Arup Rakshit arupraks...@rocketmail.com: Hi, Please look at my query : [shreyas@rails_app_test (master)]$ rails db psql (9.4.1) Type help for help. app_development=# select id,

Re: [GENERAL] What is the alternate of FILTER below Postgresql 9.4 ?

2015-02-24 Thread Andreas Kretschmer
Arup Rakshit arupraks...@rocketmail.com wrote: This *FILTER* method is available from 9.4, How can I get the same output below 9.4 version ? case when ... see: http://www.cybertec.at/postgresql-9-4-aggregation-filters-they-do-pay-off/ Andreas -- Really, I'm not out to destroy Microsoft.

Re: [GENERAL] What is the alternate of FILTER below Postgresql 9.4?

2015-02-24 Thread Arup Rakshit
On Tuesday, February 24, 2015 06:14:53 PM Andreas Kretschmer wrote: Arup Rakshit arupraks...@rocketmail.com wrote: This *FILTER* method is available from 9.4, How can I get the same output below 9.4 version ? case when ... see:

Re: [GENERAL] What is the alternate of FILTER below Postgresql 9.4 ?

2015-02-24 Thread Ken Tanzer
I tried, but it is not giving the output exactly like *FILTER*. app_development=# select CASE WHEN lower(location) = 'x' THEN COUNT(id) ELSE 0 END AS X_loc, CASE WHEN lower(location) != 'x' THEN COUNT(id) ELSE 0 END AS Non_X_loc from people group by lower(location); x_loc | non_x_loc