Function in databricks
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2023 01:26 AM
Im having a hard time to convert below function from SSMS to databricks function. Any help would be appreciated!
CREATE FUNCTION [dbo].[MaxOf5Values] (@D1 [int],@D2 [int],@D3 [int],@D4 [int],@D5 [int]) RETURNS int
AS
BEGIN
DECLARE @Result int
SET @Result = COALESCE(@D1, @D2, @D3, @D4, @D5)
IF @D2 IS NOT NULL AND @D2 > @Result SET @Result = @D2
IF @D3 IS NOT NULL AND @D3 > @Result SET @Result = @D3
IF @D4 IS NOT NULL AND @D4 > @Result SET @Result = @D4
IF @D5 IS NOT NULL AND @D5 > @Result SET @Result = @D5
RETURN @Result
END
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2023 06:38 AM
Hi @Givi Salu ,
Please refer to this link that will help you convert this function.
Ajay Kumar Pandey

