ClickHouse/tests/queries/0_stateless/03241_view_block_structure.sql
2024-09-22 23:25:02 +02:00

27 lines
777 B
SQL

DROP TABLE IF EXISTS foo;
DROP TABLE IF EXISTS vfoo;
CREATE TABLE foo(to_dttm DateTime) ENGINE = MergeTree() ORDER BY ();
CREATE VIEW vfoo AS
SELECT CAST(foo.to_dttm AS DateTime64(6)) AS feature,
toDateTime64('2024-03-26 11:35:03.620846', 6) AS to_dttm
FROM foo;
SELECT * FROM vfoo WHERE vfoo.to_dttm=toDateTime64('2024-03-26 11:35:03.620846', 6);
DROP TABLE vfoo;
DROP TABLE foo;
CREATE TABLE foo(to_dttm_blaaaaaaaaaaaaaa DateTime) ENGINE = MergeTree() ORDER BY ();
CREATE VIEW vfoo AS
SELECT CAST(foo.to_dttm_blaaaaaaaaaaaaaa AS DateTime64(6)) AS feature,
toDateTime64('2024-03-26 11:35:03.620846', 6) AS to_dttm
FROM foo;
SELECT * FROM vfoo WHERE vfoo.to_dttm=toDateTime64('2024-03-26 11:35:03.620846', 6);
DROP TABLE vfoo;
DROP TABLE foo;