mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-04 21:42:39 +00:00
22 lines
267 B
MySQL
22 lines
267 B
MySQL
|
drop table if exists tbl_repr;
|
||
|
|
||
|
CREATE TABLE tbl_repr(
|
||
|
ts DateTime,
|
||
|
x String)
|
||
|
ENGINE=MergeTree ORDER BY ts;
|
||
|
|
||
|
|
||
|
SELECT *
|
||
|
FROM
|
||
|
(
|
||
|
SELECT
|
||
|
x,
|
||
|
length(x)
|
||
|
FROM tbl_repr
|
||
|
WHERE ts > now()
|
||
|
LIMIT 1
|
||
|
)
|
||
|
WHERE x != '';
|
||
|
|
||
|
drop table if exists tbl_repr;
|