[dba-SQLServer] Support for Filter clause?

Stuart McLachlan stuart at lexacorp.com.pg
Fri Jan 29 02:24:50 CST 2016


Nope, Definitely not in 2014 - it throws an error.

And it doesn't appear to be  implemented in the current 2016 CTP.  It's  still listed as a "future 
keyword which should  be avoided as an identifier" if you tunnel down in the 2016 
documentation.   

(Actually, they haven't implemented any new keywords since 2008 according to that 
Keywords list).


-- 
Stuart
 

On 26 Jan 2016 at 15:05, Arthur Fuller 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