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

后端 未结 2 520
栀梦
栀梦 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:14

    Select CONVERT(DECIMAL(6,4),COUNT(*)) / CONVERT(DECIMAL(6,4),20000) FROM TABLE
    

    - Its important that you match the type explicitly because not all numbers are integers and not all decimals are the same. DECIMAL(6,4) is effectively its own data type which is not the same as DECIMAL(6,3).

提交回复
热议问题