Snowflake Vs MS-SQL - Part 5 - Top n rows

    



Top n rows 

 

MS-SQL Server 

Suppose if you want to pull only limited data then you can use TOP N clause.




However in Snowflake we can achieve this by two ways.

1. Top clause:
    
    This is similar to MS-SQL Server.
    
    For more details, you can refer the following LINK

2. Limit clause:

    You can mention this clause at the end of SQL Statement.

    
    This LIMIT clause provides you more flexibility if you use OFFSET along with it. 
    For more details, you can refer the following LINK.


But if you try to use both of these clauses in single SQL statement then it throws a compilation error(Duplicate LIMIT).



Yogesh Shinde

LinkedInProfile

<<< Back Next >>>


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