回答編集履歴

3

コードの単純ミスの修正

2016/03/14 15:03

投稿

Odacchi
Odacchi

スコア907

test CHANGED
@@ -32,7 +32,7 @@
32
32
 
33
33
  and DEL_FLG = 0
34
34
 
35
- and count(*) <= 20
35
+ and rank <= 20
36
36
 
37
37
  order by KBN asc,TANKA desc
38
38
 

2

コードミス修正

2016/03/14 15:03

投稿

Odacchi
Odacchi

スコア907

test CHANGED
@@ -32,7 +32,7 @@
32
32
 
33
33
  and DEL_FLG = 0
34
34
 
35
- and count(*) <= 19
35
+ and count(*) <= 20
36
36
 
37
37
  order by KBN asc,TANKA desc
38
38
 

1

ソースコード間違いの修正

2016/03/14 12:36

投稿

Odacchi
Odacchi

スコア907

test CHANGED
@@ -22,7 +22,7 @@
22
22
 
23
23
  t1.XX_NO as XX_NO,
24
24
 
25
- (select count(*) +1 from XXtable as t2 where 1 and CAST(CAST(t2.RESULT as UNSIGNED) as SIGNED) > CAST(CAST(t1.RESULT as UNSIGNED) as SIGNED) and concat(t2.KBN,t2.TANKA)= concat(t1.KBN,t1.TANKA) and count(*) <= 19) as rank
25
+ (select count(*) +1 from XXtable as t2 where 1 and CAST(CAST(t2.RESULT as UNSIGNED) as SIGNED) > CAST(CAST(t1.RESULT as UNSIGNED) as SIGNED) and concat(t2.KBN,t2.TANKA)= concat(t1.KBN,t1.TANKA) ) as rank
26
26
 
27
27
  from XXtable as t1
28
28
 
@@ -30,7 +30,9 @@
30
30
 
31
31
  and DATE like '2016-03-12%'
32
32
 
33
- and DEL_FLG = 0
33
+ and DEL_FLG = 0
34
+
35
+ and count(*) <= 19
34
36
 
35
37
  order by KBN asc,TANKA desc
36
38