ClickHouse/tests/queries/0_stateless/00759_kodieg.sql
Ivan 97f2a2213e
Move all folders inside /dbms one level up ()
* Move some code outside dbms/src folder
* Fix paths
2020-04-02 02:51:21 +03:00

5 lines
200 B
SQL

SELECT
[1, 2, 3, 1, 3] AS a,
indexOf(arrayReverse(arraySlice(a, 1, -1)), 3) AS offset_from_right,
arraySlice(a, multiIf(offset_from_right = 0, 1, (length(a) - offset_from_right) + 1));