Return the first non-null value in a list:
SELECT COALESCE(NULL, NULL, NULL, '91xjr.com', NULL, 'Example.com');
Try it Yourself »
The COALESCE() function returns the first non-null value in a list.
COALESCE(
val1,
val2,
....,
val_n)
Parameter | Description |
---|---|
val1, val2, val_n | Required. The values to test |
Works in: | From MySQL 4.0 |
---|
Return the first non-null value in a list:
SELECT COALESCE(NULL, 1, 2, '91xjr.com');
Try it Yourself »
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!