sql – how to get decimal for an inetger

 

 

multiple ways of doing this.

select distinct inputvalue,
, round(CAST( inputvalueAS DOUBLE PRECISION ) / 1000.0, 3) — doesn’t secure 3 decimals
, round(inputvalue/1000.0,3) —  by default 6 decimals
, cast(inputvalue/1000.0 as float)
, convert(numeric (15,3), inputvalue/1000.0)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s