Re: Three valued logic (again)
Posted in 1997
With 7.2x, the notation below counts the number of non-null values in the
specified column. It is an SQL-92 feature which has finally been added to
Informix databases.
SELECT COUNT(Column) FROM Table [WHERE ...];
In Oyvind's example, the answer is guaranteed to be zero because the number
of non-null values which are null is 0.
SELECT COUNT(col) FROM tbl WHERE col IS NULL;
Yours,
Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>
}From: ogj@tglobe3.tollpost.no (Oyvind Gjerstad)
}Date: 06 Mar 1997 09:25:24 +0100
}X-Informix-List-Id: <news.34856>
}
}> set explain on;
}> CREATE TABLE tbl ( col int);
}> =
}
}> INSERT INTO tbl VALUES (1);
}> INSERT INTO tbl VALUES ('');
}> =
}
}> SELECT COUNT(*) FROM tbl WHERE col IS NULL;
}> SELECT COUNT(col) FROM tbl WHERE col IS NULL;
}
}I get syntax error on this one. In isql 4.00, dbaccess 5.00, dbaccess 7.14.