Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

In the where clause of a bit column, NULL is used to signify when the value of the column is undefined or unknown. To filter results based on a NULL value in a bit column, the IS NULL or IS NOT NULL operator is used.

For example, to retrieve records where the bit column named "active" is NULL, the following SQL query can be used:

SELECT * FROM table_name WHERE active IS NULL;

Similarly, to retrieve records where the bit column named "active" is not NULL (i.e. has a defined value), the following SQL query can be used:

SELECT * FROM table_name WHERE active IS NOT NULL;