Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In the SQL standard, can floating-point columns hold NaN?

In the official SQL standard (now ISO/IEC 9075 if I'm not mistaken), can a column/attribute of a floating-point type hold NaN's as legitimate non-null values?

Notes:

  • I'm not asking about any specific DBMS.
  • Please regard the latest SQL standard version you are familiar with.
  • If you know the answer has changed between versions of the standard, do indicate this.
like image 918
einpoklum Avatar asked Oct 24 '25 03:10

einpoklum


1 Answers

As of 2011 version of SQL standard, it cannot. There are two kinds of number types (exact and approximate) and both are defined in terms of mantissa (unscaled value) and exponent (scale). No place defined for special cases like Inf or NaN.

like image 127
Netch Avatar answered Oct 25 '25 18:10

Netch



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!