Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Trim numbers
declare @mytable table (value varchar(25) not null) insert into @mytable (value) values ('1.31'),('5.00'),('2.500'),('6.00'),('8.0000'),('1.0'),('3.0000000') select coalesce(cast((case when DecimalValue = floor(DecimalValue) then cast(DecimalValue as int) end) as varchar(25)), VarcharValue) from (select cast(value as decimal(18,9)) as DecimalValue, value as VarcharValue from @mytable) as tmp
run
|
edit
|
history
|
help
0
products table
mywall
Task_6_Final
Libros
CREATE DATABASE
hdudh
replace string
ERROR
Time Difference Calculation (amended v2)
Pivot unpivot