You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CREATETABLEtd (id Int16, d Date) ENGINE=MergeTree() order by id;
5
+
CREATETABLEtdt (id Int16, dt DateTime) ENGINE=MergeTree() order by id;
6
+
7
+
insert into td values (1,'2025-03-01'),(2,'2025-04-01');
8
+
insert into tdt values (1,'2025-03-01 01:01:01'),(2,'2025-03-01 02:01:01'),(3,'2025-04-01 03:01:01'),(4,'2025-04-01 04:01:01'),(5,'2025-04-01 05:01:01');
9
+
10
+
SELECT td_d FROM (SELECTt.id td_id, t.d td_d, uniqExact(tdt.id) as cnt FROM td as t LEFT JOIN tdt ON toDate(tdt.dt) =t.dGROUP BY td_id, td_d) WHERE td_d ='2025-04-01';
11
+
SELECT td_d FROM (SELECTt.id td_id, t.d td_d, uniqExact(tdt.id) as cnt FROM tdt RIGHT JOIN td as t ON toDate(tdt.dt) =t.dGROUP BY td_id, td_d) WHERE td_d ='2025-04-01';
12
+
13
+
SELECT td_d FROM (SELECTt.id td_id, t.d td_d, uniqExact(tdt.id) as cnt FROM td as t INNER JOIN tdt ON toDate(tdt.dt) =t.dGROUP BY td_id, td_d) WHERE td_d ='2025-04-01';
14
+
SELECT td_d FROM (SELECTt.id td_id, t.d td_d, uniqExact(tdt.id) as cnt FROM tdt INNER JOIN td as t ON toDate(tdt.dt) =t.dGROUP BY td_id, td_d) WHERE td_d ='2025-04-01';
0 commit comments