Rjdudley
Honored Contributor

1) Rather than a CTE you might be better served by creating another dataframe and querying from that.  Dataframes are more native to the Spark platform and you can have more than one in a notebook.

2) The DB-SQL language reference is SQL language reference - Azure Databricks - Databricks SQL | Microsoft Learn.  Regarding TOP/LIMIT, almost every SQL dialect has its own way of limiting results but LIMIT is common in open source databases like MySQL and PostgreSQL, which is probably why it was chosen for DB-SQL.