Nulls Indicate Absence of Value (162)
A null is the absence of a value in a column of a row. Nulls indicate missing,
unknown, or inapplicable data. A null should not be used to imply any other value,
such as zero. A column allows nulls unless a NOT NULL or PRIMARY KEY integrity
constraint has been defined for the column, in which case no row can be inserted
without a value for that column.
Nulls are stored in the database if they fall between columns with data values. In these
cases they require 1 byte to store the length of the column (zero).
Trailing nulls in a row require no storage because a new row header signals that the
remaining columns in the previous row are null. For example, if the last three columns
of a table are null, no information is stored for those columns. In tables with many
columns, the columns more likely to contain nulls should be defined last to conserve
disk space.
Most comparisons between nulls and other values are by definition neither true nor
false, but unknown. To identify nulls in SQL, use the IS NULL predicate. Use the SQL
function NVL to convert nulls to non-null values.
Nulls are not indexed, except when the cluster key column value is null or the index is
a bitmap index.
空值
1. 空值表示一行的某列無值 . 空值的含義是資料缺失 , 未知 ,或N/A .空值不等同於其他任何值,如0 .
2. 當一個空值在一行中位於有資料值的兩列之間時 , 此列在資料庫中需要佔用 1 位元組的空間來儲存其列長(0).
3. 而當一個空值位於行尾時無需佔用儲存空間 , 因為新一行的行頭就標誌著前一行未儲存的欄位均為空 .
4. Oracle 中規定空值和其他任何值的比較結果既非真也非假 , 而是未知 . 如需在 SQL 中判斷空值 , 應該使用謂詞IS NULL .
使用者可以使用 SQL 函式 NVL 將空值轉換為非空值.
5. 空值不會被加入索引 , 但有兩種情況例外:其一是為空值的列屬於簇鍵,其二是索引為點陣圖索引
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10599713/viewspace-981253/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Indexes and Nulls (198)IndexNull
- Bitmap Indexes and Nulls (224)IndexNull
- json_strip_nullsJSONNull
- 分析函式——NULLS FIRST/LAST函式NullAST
- 162、黃鶴樓
- LeetCode 162 JavascriptLeetCodeJavaScript
- 162. 尋找峰值
- 報錯“Please indicate a valid Swagger or OpenAPI version field”SwaggerAPI
- PostgreSQL DBA(162) - Extension(pg_catcheck)SQL
- [20140621]Cluster Nulls.txtNull
- LeetCode-162-尋找峰值LeetCode
- 【NULLS】Oracle對SQL排序後NULL值位置的“特殊關照”NullOracleSQL排序
- 瞭解一下NULLs怎樣影響IN和EXISTS(轉)Null
- LOW_VALUE、HIGH_VALUE、ENDPOINT_VALUE轉換--UTL_RAW、DBMS_STATS.CONVERT_RAW_VALUE
- Oracle 11G OCP 1Z0-052 162Oracle
- 分析函式——FIRST_VALUE()和LAST_VALUE()函式AST
- new_value
- Educational Codeforces Round 162 (Rated for Div. 2) - VP記錄
- Oracle分析函式-first_value()和last_value()Oracle函式AST
- 兩個SQL語句技巧——NULLS FIRST/LAST和分析函式版AVGSQLNullAST函式
- 每週一書:162頁《笨辦法學 Python》分享!Python
- 【手摸手玩轉 OceanBase 162】發起資料備份
- JavaScript select valueJavaScript
- jQuery [attribute*=value]jQuery
- jQuery [attribute~=value]jQuery
- jQuery [attribute|=value]jQuery
- jQuery [attribute$=value]jQuery
- jQuery [attribute^=value]jQuery
- jQuery [attribute!=value]jQuery
- jQuery [attribute=value]jQuery
- 關於value objectObject
- Value Object 和 POJOObjectPOJO
- WPF ProgressBar show value
- golang multiple-value xxx in single-value contextGolangContext
- tf.clip_by_value() 用法
- Smart Value Help 總結
- Hangcheck: hangcheck value past margin!GCAST
- Map根據Value排序排序