回答編集履歴
2
typo
test
CHANGED
@@ -16,5 +16,5 @@
|
|
16
16
|
union allで連結し、
|
17
17
|
件数を数え、
|
18
18
|
件数とデータをidでjoinし、
|
19
|
-
件数の
|
19
|
+
件数の降順に並び替え、
|
20
20
|
件数を取り除く。
|
1
typo
test
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
d as (SELECT id FROM data where 読み like '%た'),
|
7
7
|
p as (select * from a union all select * from b union all select * from c union all select * from d),
|
8
8
|
x as (select count(*) _cnt, id from p group by id),
|
9
|
-
y as (select x._cnt,
|
9
|
+
y as (select x._cnt, data.* from x join data on data.id = x.id),
|
10
10
|
z as (select distinct * from y order by _cnt desc)
|
11
11
|
select id, 読み from z;
|
12
12
|
```
|