want to use limit in ClickHouse db like param, which goes to me from front, and I want use limit if I receive it, or not use if not receive.
I know example in Postgresql:
SELECT * FROM table
LIMIT CASE WHEN @param > 0 THEN @param END;
But I don't know how it make in ClickHouse without concatenation strokes. Cos if I wrote LIMIT in my sql script then I need set some number, else it won't work.
SELECT * FROM table LIMIT CASE WHEN @param > 0 THEN @param END;
I want limit by condition.