Help Refactor T-SQL Code to Databricks SQL
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2024 11:33 AM
Hello Community
Can someone help refactor the following T-SQL Code to Databricks SQL
CONVERT(DECIMAL(26, 8), ISNULL(xxx.xxxxxxx * ISNULL(RH.xxxxx, 1 / NULLIF(ST.xxxxxx, 0)), ST.xxxxx)) AS Amount
When I attempt to execute the above code I get the following error:
Error in SQL statement: AnalysisException: Undefined function: 'CONVERT'.
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2024 06:02 PM
You can use CAST instead.
Eg:
SELECT cast('2024' as int);

