RKNutalapati
Valued Contributor

Hi @Om Singh​  - You can try below, Second statement will give you the required result

%sql
Select typeof(COALESCE(Cast(3.45 as decimal(15,6)),0)) as CastToDecimal
Union All
Select typeof(Cast(COALESCE(3.45,0) as decimal(15,6))) as CastToDecimal;
 

Result of above:

 

CastToDecimal

1 decimal(16,6)

2 decimal(15,6)