mirror of
https://github.com/chaisql/chai.git
synced 2025-09-26 19:51:21 +08:00
20 lines
327 B
SQL
20 lines
327 B
SQL
-- test: simple case
|
|
> COALESCE(1,2,3)
|
|
1
|
|
|
|
-- test: with null
|
|
> COALESCE(null,2,3)
|
|
2
|
|
|
|
-- test: with different values type
|
|
> COALESCE('hey',2,3)
|
|
'hey'
|
|
|
|
-- test: with more than one null value with integer
|
|
> COALESCE(null, null, null,3)
|
|
3
|
|
|
|
-- test: with more than one null value with text
|
|
> COALESCE(null, null, null, 'hey')
|
|
'hey'
|