回答編集履歴

2

修正

2018/06/22 01:08

投稿

sazi
sazi

スコア25184

test CHANGED
@@ -1,4 +1,4 @@
1
- 「同じIDで登録された最新のCDのデータ」というを解釈しました。
1
+ 「同じIDで登録されたものの内の最新のCDのデータ」というを解釈しました。
2
2
 
3
3
  相関副問合せで、同じIDで最大のCDを条件とします
4
4
 

1

修正

2018/06/22 01:08

投稿

sazi
sazi

スコア25184

test CHANGED
@@ -10,7 +10,7 @@
10
10
 
11
11
  on tb.id=ta.id
12
12
 
13
- where not exists=(select 1 from tableb where id=tb.id and cd > tb.cd)
13
+ where not exists(select 1 from tableb where id=tb.id and cd > tb.cd)
14
14
 
15
15
  order by tb.id, tb.cd
16
16