How to use count(*) and Division Operation in SQL statements

后端 未结 2 521
栀梦
栀梦 2021-01-18 15:58

I\'m loading big data into database,

i want to know how this process going.

i use

select count(*) from table

to check how

2条回答
  •  误落风尘
    2021-01-18 16:05

    Integer division returns an integer, the decimal part is truncated. You could divide by 20000.0:

    select ( count(*)/20000.0 ) from table
    

    Demo

    MSDN / (Divide)

    If an integer dividend is divided by an integer divisor, the result is an integer that has any fractional part of the result truncated.

提交回复
热议问题