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

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -