Getting two counts and then dividing them

后端 未结 5 1578
攒了一身酷
攒了一身酷 2021-02-08 01:17

I am attempting to get two counts and then divide those two counts to get the ratio of the items I am counting. I saw this post here and tried that. I am getting an error in my

5条回答
  •  故里飘歌
    2021-02-08 02:13

    Use SELECT A.NUM, A.DENOM, cast(A.NUM as float)/cast(A.DENOM as float)

    SQL Server consider that A.NUM / A.DENOM are int, because A.NUM and A.DENUM are int

提交回复
热议问题