Use a CTE that returns the row ID and the result of the DateDiff, then join that to your existing result set? It may or may not be faster, so as always, test it to see.
Returns the number of date and time boundaries crossed between two specified dates. The datepart parameter identifies which date and time boundaries to compare. DATEDIFF returns a null result if any ...
Sqlglot is switching date_trunc to timestamp_trunc upon parsing, which is not a valid Snowflake sql function. It is also switching the argument order and unquoting the date part where it shouldn't do ...
Some results have been hidden because they may be inaccessible to you
Show inaccessible results