SQL statement ANSI_NULLS value (on| OFF) meaning

Source: Internet
Author: User

Official Note:

1. When SET ansi_nulls is on, even ifThe column_name contains null values, and a SELECT statement that uses WHERE column_name = NULL still returns 0 rows. SELECT statements that use WHERE column_name <> null will return 0 rows even if the column_name contains non-null values.

2. When SET Ansi_nulls is OFF, the Equals (=) and not equal (<>) comparison operators do not comply with the ISO standard.Use WHERECOLUMN_NAME =A NULL SELECT statement returnsA row in the column_name that contains null values. column_name &lt;&gt; null Returns the rows that has nonnull values in the column. "Data-guid=" 48318408e8d81f498 9f2d49a9141e13c "> use Where COLUMN_NAME<>&NBSP; null The   SELECT statement returns rows that contain non-null values in the column.  column_name &lt;&gt; xyz_value Returns all rows that is not xyz_value And that is not NULL. "Data-guid=" 8a23fee7bb64b490069c7e35649758da "> Also, use Where column _name <> xyz_value  the SELECT statement returns all not  

SQL statement ANSI_NULLS value (on| OFF) meaning

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.