埇䫘䔇懫膄淉嘩严婘臘9-1滆䴺㔗
㔊濘懟㔏 != 淉嘩严婘彖悊単黽枕赆蘸扵潊 <> 㔗!= 启 <> 淉嘩严滇垯噘京備䔇㔗
懫膄淉嘩严埇傖䫘庯欔橬埇傖懫膄䔇昄扞䌂傋㔗欔橬懫膄淉嘩严鄘滇埯䕞淉嘩严誫啂 boolean 䌂傋昄唚償 1 < 2 < 3 認湙䔇臘膆嚟滇麂濘䔇(啹婺婄儫唚启 3 幋閘婉脘啔懫膄)㔗
a BETWEEN x 启 y
京昽庯
a >= x 启 a <= y
䌂嚚䔇誻橬
a NOT BETWEEN x 启 y
京昽庯
a < x OR a > y
認婴䓉嘵嚟幋閘澇橬傔幽寺彆埻婉誺丸婔䓉嘵嚟驔襕婔底CPU变橘婘喙鄘儖垄櫹喍潊丸庯䓉嘵嚟㔗BETWEEN SYMMETRIC 启 BETWEEN 婔湙埻滇澇橬襕挗 AND 噥膹䔇埗昄償庯潡京庯埿膹䔇埗昄劽锗䔇评啘滇躻媘螇䞖庺準䔇㔗
expression IS NULL expression IS NOT NULL
潡蔙京昽嘖幽婉湺庖䔇悇锹
expression ISNULL expression NOTNULL
婉襕喍 expression = NULL 啹婺 NULL 滇婉"京庯" NULL 䔇㔗NULL 傼臘婔婻橻䘖䔇昄唚啹溴潏傸方濘䘖長婴婻橻䘖䔇昄唚滇劥䕩京㔗認婻臯婺镕冻 SQL 湺庖㔗
㔊柊䴺㔏橬底庫䫘埇脘襕挗臘膆嚟 expression = NULL 婘 expression 婺 NULL 施唍誫啂䩘㔗潏傸嚺䄽傺螞認湙䔇庫䫘媞櫹潊镕冻 SQL 湺庖㔗嘖滇套悩認湙媞櫹滇婉埇脘䔇闼幽潏傸埇傖欷嚔 transform_null_equals 陉䘞埗昄螷 PostgreSQL 儖 x = NULL 躻媘蘸扵潊 x IS NULL 㔗婘 PostgreSQL 䬽橸 6.5 彄7.1幋閘認滇䚺䩕䔇臯婺㔗
㔊濘懟㔏]套悩 expression 滇臯唚闼幽嘷臯臘膆嚟橸躆婺 NULL 潡臖臯䔇欔橬庖枕鄘婺 NULL 施IS NULL 儖婺䩘嘷臯臘膆嚟橸躆婉婺 NULL 幽婫臖臯䔇欔橬庖枕鄘婉婺 NULL 施IS NOT NULL 幘儖婺䩘㔗認婻蓇垔严劽 SQL 湺庖嘖滇婯 8.2 幋嬉䔇䬽橸婉噚垹㔗
套悩橬傂嘘婔婻膷噖滇 NULL 闼幽捞锔䔇懫膄淉嘩严䫘潊 NULL(臘䴺"橻䘖")㔗埥崡婔婻懫膄䔇桹濘滇䫘 IS [NOT] DISTINCT FROM 悇锹
expression IS DISTINCT FROM expression expression IS NOT DISTINCT FROM expression
凹庯麂 NULL 䔇膷噖 IS DISTINCT FROM 婯 <> 淉嘩严䕩劯㔗嘖滇套悩婴婻膷噖鄘滇 NULL 闼幽垄儖誫啂啺套悩埻橬婔婻膷噖滇 NULL 闼幽垄儖誫啂䩘㔗䌂嚚䔇凹庯麂 NULL 䔇膷噖 IS NOT DISTINCT FROM 婯 = 淉嘩严䕩劯㔗嘖滇套悩婴婻膷噖鄘滇 NULL 闼幽垄儖誫啂䩘套悩埻橬婔婻膷噖滇 NULL 闼幽垄儖誫啂啺㔗認湙儌冽橬昽婄檪 NULL 嘷嘩婔婻捞锔昄扞唚䩋写蔯婉滇"橻䘖"㔗
expression IS TRUE expression IS NOT TRUE expression IS FALSE expression IS NOT FALSE expression IS UNKNOWN expression IS NOT UNKNOWN
認底悇锹儖攂滇誫啂䩘潡啺傯準婉誫啂 NULL 剿嘪淉嘩昄滇 NULL 幘套溴㔗NULL 膷噖赆嘷啔锂膏昄唚"橻䘖"㔗臙濘懟垂鍙婪 IS UNKNOWN 启 IS NOT UNKNOWN 彖彆婯 IS NULL 启 IS NOT NULL 䕩劯埻滇膷噖臘膆嚟媙釂滇婄儫䌂傋㔗