質問編集履歴
4
修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
(nameが1件でもnullの場合、そのidは取得しない)
|
3
3
|
|
4
4
|
|
5
|
-
table_a(PKなし)
|
5
|
+
table_a(PKなし 各カラムのデータ型はtext)
|
6
6
|
|id|name|
|
7
7
|
|:--|--:|
|
8
8
|
|1|ichiro|eigyou|
|
3
修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
(nameが1件でもnullの場合、そのidは取得しない)
|
3
3
|
|
4
4
|
|
5
|
-
table_a
|
5
|
+
table_a(PKなし)
|
6
6
|
|id|name|
|
7
7
|
|:--|--:|
|
8
8
|
|1|ichiro|eigyou|
|
2
環境追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -14,4 +14,7 @@
|
|
14
14
|
また、サブクエリを使ったとしても下記以外の取得方法はありますでしょうか?
|
15
15
|
|
16
16
|
select distinct id from table_a
|
17
|
-
where id not in (select id from table_a where name is null);
|
17
|
+
where id not in (select id from table_a where name is null);
|
18
|
+
|
19
|
+
環境
|
20
|
+
PostgreSQL(9.5.13)
|
1
訂正
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
下記テーブルでnameがnullでないidを重複なく取得したいです。
|
2
|
+
(nameが1件でもnullの場合、そのidは取得しない)
|
2
3
|
|
3
4
|
|
4
5
|
table_a
|