CAST DECIMAL to INT

后端 未结 10 2334
攒了一身酷
攒了一身酷 2020-12-13 01:49

I\'m trying to do this:

SELECT CAST(columnName AS INT), moreColumns, etc
FROM myTable
WHERE ...

I\'ve looked at the help FAQs here: http://

10条回答
  •  甜味超标
    2020-12-13 02:16

    There is an important difference between floor() and DIV 1. For negative numbers, they behave differently. DIV 1 returns the integer part (as cast as signed does), while floor(x) returns "the largest integer value not greater than x" (from the manual). So : select floor(-1.1) results in -2, while select -1.1 div 1 results in -1

提交回复
热议问题