c# - Division by table column -
this question has answer here:
can know why divider not showing value?
select gg.columna ,t.columnb, (gg.columna / t.columnb) c #main t left outer join #total_bygradegender gg on t.organizationcd = gg.organizationcd , t.countrycd = gg.countrycd where t.organizationcd = '27849'
the value last column showing 0. isn't should columna/12 ?
8 12 0 1 12 0 3 12 0
if change divider integer, value show.
you need cast numeric
select gg.columna ,t.columnb, (gg.columna /cast( t.columnb numeric)) c #main t left outer join #total_bygradegender gg on t.organizationcd = gg.organizationcd , t.countrycd = gg.countrycd t.organizationcd = '27849'
Comments
Post a Comment