Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Jonathan Leffler — — source: Informix-list mailing list archive (1991-1998)
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.
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.