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
SI 1
delete all data from given scheme tables
Dynamic Sql command with output variable
do several updates at once
extract part of a string
Get all dates between two given dates
how-to-assign-a-random-value-in-a-select-statement-in-sqlserver
2021.02.24 Lab 4
"OrderForm.asp?Cart="
SQL - Find series of timestamps with small gaps