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
Arif First Query
BRYANActual
SQL Directives Order of Execution
group for team members and winners in sql-server
Practice
EXP 8 q2
MS SQL Joins
Workers information
Week 6 Data Base IET
Chaudhary