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

         



ON Clause & Cross Join

We use different joins to pull the records from multiple tables. We need to use the ON clause along with JOIN. What will happen if we don't use the ON clause?


MS-SQL Server 

If we don't mention the ON clause, it throws an error. However, if we use the same column from the same table on both sides, it works as a cross-join. 

Also, if you mention condition as 1=1 in the ON clause, it treats as CROSS JOIN.


However, in Snowflake, both above queries will work. 

Apart from this, if you don't mention the ON clause, it treats it as CROSS JOIN:




  

Comments

Popular posts from this blog

Snowflake Vs MS-SQL - Part 36 - SPLIT_TO_TABLE

Snowflake Vs MS-SQL - Part 33 - INITCAP