Snowflake Vs MS-SQL - Part 9 - Count based on condition

     


Count based on condition


MS-SQL Server 

If you want to take a count based on condition then you have to use where clause. 

Scenario 1:


Scenario 2:



In Snowflake we can achieve this by using same queries as above. However there is an alternative solution as below:


Scenario 1:




Scenario 2:



I have not compared the performance, if anyone knows then please comment.

For more details, you can refer the following LINK.


Comments

Popular posts from this blog

Snowflake Vs MS-SQL - Part 36 - SPLIT_TO_TABLE

Snowflake Vs MS-SQL - Part 63 - ON Clause & Cross Join

Snowflake Vs MS-SQL - Part 33 - INITCAP