1。convert(numeric(8,2),num)返回两个位数的小数
2.convert(decimal(15,2),12.2)返回两个位数的小数
3.cast(SUBSTRING(PrescriptionValue,2,5)as decimal) 类型转换
4.update PrescriptionVal set PrescriptionValue='+' + CAST( convert(numeric(8,2),cast(SUBSTRING(PrescriptionValue,2,5)as float)) as nvarchar(7)) where PrescriptionTypeID =6
删除表中的数据,不删除结构。
truncate table TaobaoGM.dbo.PrescriptionVal
go
将另外一张表中的数据插入到目的表中。
insert into TaobaoGM.dbo.PrescriptionVal
select PrescriptionTypeID,PrescriptionValue,Sorter,IsShow from NewGM.dbo.OP_Prescription
更新表中的某一些字段值。
update PrescriptionVal set PrescriptionValue = convert(decimal(12,2),PrescriptionValue)+1.50
where PrescriptionTypeID = 6 or PrescriptionTypeID = 7
update PrescriptionVal set IsShow = 0
where (convert(decimal(12,2),PrescriptionValue)<3.5
or c