I’m trying to convert the following statement from SQL Server to Oracle, but everything I’ve tried gives me different errors. Does anyone know how to convert this to be oracle friendly?
select
nullif(cast(cast(round(vn02.wheelbase,0,1)-1 as integer) as varchar) + ',' +
cast(cast(round(vn02.wheelbase,0,1) as integer) as varchar) + ',' +
cast(cast(round(vn02.wheelbase,0,1)+1 as integer) as varchar),'-1,0,1') wheelbase
from vn02_fullsv vn02
wheel base if a float, and it needs to be appended to itself with comma delimiters to see if it equals ‘-1,0,1’ and if so then it should return null.
thanks for the help.
This should be close to what you are looking for:
The ‘||’ replace the + to concatenate the strings, and decode replaces the nullif.
Round works the same as your example.
Here are is a link for a reference on Decode and here is a reference for Round.