sql server - SQL returning the last registered result multiple times -
with code last registered result multiple times. want results. function. (i have entries 280x30, 360x40 @ table need 2 numbers variable calculate inch value of these numbers)
declare @value1 numeric(18,0) declare @value2 numeric(18,0) select @value2 = substring([values], charindex('x', [values]) + 1, len([values])) , @value1 = substring([values], 1, charindex('x', [values]) - 1), @value1=@value1/(2.54), @value2=@value2/(2.54) tblvalues select @value1 value1, @value2 value2 tblvalues
you this:
select tbl.value1/2.54 value1, tbl.value2/2.54 value2 ( select substring([values], charindex('x', [values]) + 1, len([values])) value2, substring([values], 1, charindex('x', [values]) - 1) value1 tblvalues ) tbl
Comments
Post a Comment