[dba-SQLServer] Support for Filter clause?

Paul Hartland paul.hartland at googlemail.com
Wed Jan 27 00:59:19 CST 2016


Never used that, we only have 2000 & 2005/2008 sql servers here at work,
even though we have upto 2014 express installed as management studio, will
have to look at that at home
On 26 Jan 2016 20:06, "Arthur Fuller" <fuller.artful at gmail.com> wrote:

> The SQL standard and Postgres support the FILTER clause, as in:
>
> SELECT
>
>   COUNT(*) FILTER (WHERE sal < 10000)
>
>       AS test1,
>
>   COUNT(*) FILTER (WHERE dept > 10)
>
>       AS test2,
>
>   COUNT(*) FILTER (WHERE hiredate > (SYSDATE - 60))
>
>       AS test3,
>
>   COUNT(*) FILTER (WHERE grade = 1)
>
>       AS test4
>
> FROM employees;
>
>
> The latest version of MS-SQL I have installed is 2012. Does anyone
> using something more recent know if the syntax above is supported?
>
>
> --
> Arthur
> _______________________________________________
> dba-SQLServer mailing list
> dba-SQLServer at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
> http://www.databaseadvisors.com
>
>


More information about the dba-SQLServer mailing list