ClickHouse/tests/queries/0_stateless/00435_coalesce.sql

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

9 lines
640 B
MySQL
Raw Normal View History

2017-03-09 20:40:36 +00:00
SELECT coalesce(), coalesce(NULL), coalesce(NULL, NULL),
coalesce(1), coalesce(1, NULL), coalesce(NULL, 1), coalesce(NULL, 1, NULL);
SELECT COALESCE(), COALESCE(NULL), COALESCE(1, NULL);
2017-03-09 20:40:36 +00:00
SELECT coalesce(number % 2 = 0 ? number : NULL, number % 3 = 0 ? number : NULL, number % 5 = 0 ? number : NULL) AS res, toTypeName(res) FROM system.numbers LIMIT 15;
SELECT coalesce(number % 2 = 0 ? number : NULL, number % 3 = 0 ? number : NULL, number) AS res, toTypeName(res) FROM system.numbers LIMIT 15;
SELECT coalesce(number % 2 = 0 ? number : NULL, number % 3 = 0 ? number : NULL, 100) AS res, toTypeName(res) FROM system.numbers LIMIT 15;