teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

4

修正

2021/04/10 07:48

投稿

nt914
nt914

スコア14

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

修正

2021/04/10 07:48

投稿

nt914
nt914

スコア14

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

環境追加

2021/04/10 07:43

投稿

nt914
nt914

スコア14

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

訂正

2021/04/10 07:41

投稿

nt914
nt914

スコア14

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