aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/sql/suites/coalesce/coalesce_few_real.sql
blob: 0eebc69cc2c089a10357409fa51afde9b25d7d93 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* postgres can not */
$optDuoFloat=Just(Just(cast(2.71 as float)));
$optDuoDouble=Just(Just(cast(3.14 as double)));
$optDuoFloatN=Just(Just(cast(null as float)));
$optDuoDoubleN=Just(Just(cast(null as double)));

select
  ($optDuoFloat ?? 0) ?? 1,
  ($optDuoDouble ?? 41) ?? 42,
  ($optDuoFloatN ?? 0) ?? 1.,
  ($optDuoDoubleN ?? 41.) ?? 42,
  ($optDuoFloatN ?? cast(40.1 as float)) ?? cast(40.2 as float),
  ($optDuoDoubleN ?? cast(40.1 as float)) ?? cast(40.2 as float),
  (($optDuoFloatN ?? 0) ?? 1.) ?? 3,
  (($optDuoDoubleN ?? 41) ?? 42) ?? 4,
  'end'
from plato.Input;