diff --git a/tests/queries/0_stateless/02808_aliases_inside_case.reference b/tests/queries/0_stateless/02808_aliases_inside_case.reference new file mode 100644 index 00000000000..140930649d3 --- /dev/null +++ b/tests/queries/0_stateless/02808_aliases_inside_case.reference @@ -0,0 +1,2 @@ +1 1 +2 0.5 diff --git a/tests/queries/0_stateless/02808_aliases_inside_case.sql b/tests/queries/0_stateless/02808_aliases_inside_case.sql new file mode 100644 index 00000000000..0da45416ed3 --- /dev/null +++ b/tests/queries/0_stateless/02808_aliases_inside_case.sql @@ -0,0 +1,10 @@ +# We support specifying aliases in any place in the query, including CASE expression: + +with arrayJoin([1,2]) as arg +select arg, + (case + when arg = 1 + then 1 as one + when arg = 2 + then one / 2 + end) as imposible;